Skip to content

Commit 12cbb6c

Browse files
committed
feat(orm): release v1.9.0 with examples rewrite, API stabilization and UoW fixes
- rewrite entire examples suite (16 structured examples) - add examples CMake integration with automatic build + migrations support - stabilize ORM API (Entity, Mapper, Repository, QueryBuilder, db_compat) - fix UnitOfWork move semantics (remove invalid move assignment) - fix const correctness for connection access - align examples with current API (entity construction, usage) - clean legacy examples and replace with structured system - improve README with clearer positioning and real usage examples This release reinforces Vix ORM as a thin, explicit layer on top of Vix DB, focused on clarity, predictability, and zero hidden behavior.
1 parent 31c53a6 commit 12cbb6c

35 files changed

Lines changed: 2506 additions & 871 deletions

CHANGELOG.md

Lines changed: 161 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,212 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
All notable changes to **Vix ORM** are documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
This project follows a developer-first approach:
6+
- explicit changes
7+
- no hidden behavior
8+
- predictable evolution
79

810
---
911

10-
### Changed
12+
## [1.9.0] - 2026-03-28
1113

12-
-
14+
### Highlights
1315

14-
### Removed
16+
This release focuses on **clarity, correctness, and developer experience**.
1517

16-
-
18+
- Full rewrite of examples
19+
- API consistency improvements
20+
- Fixes for move semantics and const correctness
21+
- Cleaner positioning of ORM as a **pure explicit layer on top of Vix DB**
1722

18-
## [0.1.2] - 2025-10-06
23+
---
1924

2025
### Added
2126

22-
-
27+
- Complete structured examples suite (16 examples):
28+
29+
- basic repository usage
30+
- full CRUD flows
31+
- unit of work
32+
- batch operations
33+
- query builder usage
34+
- error handling
35+
- custom repositories
36+
- SQLite / MySQL integration
37+
- migrations (code + files)
38+
- entity identity handling
39+
- manual SQL integration
40+
41+
- `examples/CMakeLists.txt`:
42+
- automatic registration of examples
43+
- unified build output
44+
- migration files auto-copy
45+
46+
---
2347

2448
### Changed
2549

26-
-
50+
- **README.md**
51+
- rewritten for clarity and positioning
52+
- stronger “explicit ORM” philosophy
53+
- real-world usage examples added
54+
55+
- **ORM API stabilization**
56+
57+
- `Entity`
58+
- clarified identity model
59+
60+
- `Mapper`
61+
- standardized:
62+
- `toInsertFields`
63+
- `toUpdateFields`
64+
65+
- `Repository`
66+
- improved SQL generation clarity
67+
- stricter behavior on empty fields
68+
69+
- `QueryBuilder`
70+
- safer parameter handling
71+
- improved API consistency
72+
73+
- `db_compat.hpp`
74+
- centralized DB interop layer
75+
- cleaner type exposure
76+
77+
- **CMake**
78+
- improved example integration
79+
- better standalone + monorepo compatibility
80+
81+
---
2782

2883
### Removed
2984

30-
-
85+
- Legacy examples:
86+
- batch_insert_tx.cpp
87+
- error_handling.cpp
88+
- querybuilder_update.cpp
89+
- repository_crud_full.cpp
90+
- tx_unit_of_work.cpp
91+
- users_crud.cpp
92+
93+
Replaced by a structured numbered examples system.
94+
95+
---
96+
97+
### Fixed
98+
99+
- **UnitOfWork**
100+
101+
- removed invalid move assignment
102+
(Transaction is non-assignable)
103+
104+
- fixed const correctness for `conn()`
105+
106+
- **Examples**
107+
108+
- fixed entity initialization issues
109+
- aligned examples with current API
110+
111+
- **General**
112+
113+
- improved build stability for examples
114+
- fixed multiple compilation edge cases
31115

32-
## [0.1.1] - 2025-10-06
116+
---
117+
118+
## [1.8.0]
33119

34120
### Added
121+
- `vix.json` module definition for `@vix/orm`
122+
- improved packaging (header + source module)
123+
124+
---
35125

36-
-
126+
## [1.7.x]
37127

38128
### Changed
129+
- standalone build improvements
130+
- fetch only required modules (`core`, `db`)
39131

40-
-
132+
### Fixed
133+
- CI stability
134+
- CMake standalone issues
41135

42-
### Removed
136+
---
43137

44-
-
138+
## [1.6.0]
45139

46-
### Added
140+
### Changed
141+
- stabilized public API
142+
- improved examples
143+
- inline templates
144+
145+
---
47146

48-
- Modular C++ framework structure with `core`, `orm`, `cli`, `docs`, `middleware`, `websocket`, `devtools`, `examples`.
49-
- `App` class for simplified HTTP server setup.
50-
- Router system supporting dynamic route parameters (`/users/{id}` style).
51-
- JSON response wrapper using `nlohmann::json`.
52-
- Middleware system for request handling.
53-
- Example endpoints `/hello`, `/ping`, and `/users/{id}`.
54-
- Thread-safe signal handling for graceful shutdown.
55-
- Basic configuration system (`Config` class) to manage JSON config files.
147+
## [1.5.0]
56148

57149
### Changed
150+
- internal refactor
151+
152+
---
58153

59-
- Logger integrated using `spdlog` with configurable log levels.
60-
- Improved request parameter extraction for performance.
154+
## [1.4.x]
155+
156+
### Added
157+
- file-based migrations runner
158+
- CLI migration support
61159

62160
### Fixed
161+
- MySQL driver gating
162+
- connection abstraction issues
163+
164+
---
63165

64-
- Path parameter extraction to correctly handle `string_view` types.
65-
- Fixed default response for unmatched routes (`404` JSON message).
166+
## [1.3.0]
167+
168+
### Fixed
169+
- CMake integration
170+
- MySQL linking issues
66171

67172
---
68173

69-
## [0.1.0] - 2025-10-06
174+
## [1.2.x]
70175

71176
### Added
177+
- `Database` abstraction
178+
- multi-engine support (MySQL / SQLite)
72179

73-
- Initial release of core module with working HTTP server.
74-
- Basic routing system and request handlers.
75-
- Simple example endpoints demonstrating JSON and text responses.
76-
- Thread-safe server shutdown handling.
77-
- Integration of performance measurement scripts (FlameGraph ready).
180+
---
181+
182+
## [1.1.x]
78183

79184
### Changed
185+
- modern CMake
186+
- MySQL / SQLite detection
187+
- sanitizers
188+
- documentation improvements
80189

81-
- Optimized route parameter parsing to avoid `boost::regex` overhead.
190+
---
82191

83-
### Fixed
192+
## [1.0.0]
84193

85-
- Compilation errors due to `string_view` mismatch in request handler.
86-
- Minor bug fixes in App initialization and signal handling.
194+
### Added
195+
Initial release:
196+
197+
- ConnectionPool
198+
- Transaction system
199+
- UnitOfWork
200+
- MySQL driver
201+
- modular CMake
202+
- documentation + examples
87203

88204
---
89205

90-
## [0.0.1] - Draft
206+
## Philosophy
207+
208+
Vix ORM evolves with one invariant:
91209

92-
- Project skeleton created.
93-
- Basic CMake setup and folder structure.
94-
- Placeholder modules for `core`, `orm`, and `examples`.
210+
> No magic
211+
> No hidden cost
212+
> No abstraction leaks

CMakeLists.txt

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,30 +148,87 @@ endif()
148148
# ------------------------------------------------------------------------------
149149
# Examples
150150
# ------------------------------------------------------------------------------
151-
function(vix_add_orm_example name file)
152-
add_executable(${name} ${file})
153-
target_link_libraries(${name} PRIVATE vix::orm)
151+
function(vix_add_orm_example target_name file_path)
152+
add_executable(${target_name} ${file_path})
153+
154+
target_link_libraries(${target_name} PRIVATE vix::orm)
154155

155156
if (VIX_ENABLE_SANITIZERS AND TARGET vix_sanitizers)
156-
target_link_libraries(${name} PRIVATE vix_sanitizers)
157+
target_link_libraries(${target_name} PRIVATE vix_sanitizers)
157158
endif()
158159

159160
if (MSVC)
160-
target_compile_options(${name} PRIVATE ${_WARNINGS_MSVC})
161+
target_compile_options(${target_name} PRIVATE ${_WARNINGS_MSVC})
161162
else()
162-
target_compile_options(${name} PRIVATE ${_WARNINGS_GNU})
163+
target_compile_options(${target_name} PRIVATE ${_WARNINGS_GNU})
163164
endif()
165+
166+
set_target_properties(${target_name}
167+
PROPERTIES
168+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples
169+
)
164170
endfunction()
165171

166172
if (VIX_ORM_BUILD_EXAMPLES)
167-
vix_add_orm_example(repository_crud_full
168-
${CMAKE_CURRENT_SOURCE_DIR}/examples/repository_crud_full.cpp)
169-
vix_add_orm_example(querybuilder_update
170-
${CMAKE_CURRENT_SOURCE_DIR}/examples/querybuilder_update.cpp)
171-
vix_add_orm_example(tx_unit_of_work
172-
${CMAKE_CURRENT_SOURCE_DIR}/examples/tx_unit_of_work.cpp)
173-
vix_add_orm_example(error_handling
174-
${CMAKE_CURRENT_SOURCE_DIR}/examples/error_handling.cpp)
173+
vix_add_orm_example(orm_example_01_basic_repository
174+
${CMAKE_CURRENT_SOURCE_DIR}/examples/01_basic_repository.cpp)
175+
176+
vix_add_orm_example(orm_example_02_repository_crud
177+
${CMAKE_CURRENT_SOURCE_DIR}/examples/02_repository_crud.cpp)
178+
179+
vix_add_orm_example(orm_example_03_find_all_and_count
180+
${CMAKE_CURRENT_SOURCE_DIR}/examples/03_find_all_and_count.cpp)
181+
182+
vix_add_orm_example(orm_example_04_exists_and_delete
183+
${CMAKE_CURRENT_SOURCE_DIR}/examples/04_exists_and_delete.cpp)
184+
185+
vix_add_orm_example(orm_example_05_unit_of_work
186+
${CMAKE_CURRENT_SOURCE_DIR}/examples/05_unit_of_work.cpp)
187+
188+
vix_add_orm_example(orm_example_06_batch_insert_tx
189+
${CMAKE_CURRENT_SOURCE_DIR}/examples/06_batch_insert_tx.cpp)
190+
191+
vix_add_orm_example(orm_example_07_query_builder_select
192+
${CMAKE_CURRENT_SOURCE_DIR}/examples/07_query_builder_select.cpp)
193+
194+
vix_add_orm_example(orm_example_08_query_builder_update
195+
${CMAKE_CURRENT_SOURCE_DIR}/examples/08_query_builder_update.cpp)
196+
197+
vix_add_orm_example(orm_example_09_error_handling
198+
${CMAKE_CURRENT_SOURCE_DIR}/examples/09_error_handling.cpp)
199+
200+
vix_add_orm_example(orm_example_10_custom_repository
201+
${CMAKE_CURRENT_SOURCE_DIR}/examples/10_custom_repository.cpp)
202+
203+
vix_add_orm_example(orm_example_11_sqlite_repository
204+
${CMAKE_CURRENT_SOURCE_DIR}/examples/11_sqlite_repository.cpp)
205+
206+
vix_add_orm_example(orm_example_12_mysql_repository
207+
${CMAKE_CURRENT_SOURCE_DIR}/examples/12_mysql_repository.cpp)
208+
209+
vix_add_orm_example(orm_example_13_migrations_code
210+
${CMAKE_CURRENT_SOURCE_DIR}/examples/13_migrations_code.cpp)
211+
212+
vix_add_orm_example(orm_example_14_migrations_files
213+
${CMAKE_CURRENT_SOURCE_DIR}/examples/14_migrations_files.cpp)
214+
215+
vix_add_orm_example(orm_example_15_entity_identity
216+
${CMAKE_CURRENT_SOURCE_DIR}/examples/15_entity_identity.cpp)
217+
218+
vix_add_orm_example(orm_example_16_manual_sql_with_orm
219+
${CMAKE_CURRENT_SOURCE_DIR}/examples/16_manual_sql_with_orm.cpp)
220+
221+
# Migration files needed by migration examples
222+
foreach(_migration_target
223+
orm_example_13_migrations_code
224+
orm_example_14_migrations_files
225+
)
226+
add_custom_command(TARGET ${_migration_target} POST_BUILD
227+
COMMAND ${CMAKE_COMMAND} -E copy_directory
228+
${CMAKE_CURRENT_SOURCE_DIR}/examples/migrations
229+
$<TARGET_FILE_DIR:${_migration_target}>/migrations
230+
)
231+
endforeach()
175232
endif()
176233

177234
# ------------------------------------------------------------------------------
@@ -211,4 +268,6 @@ else()
211268
message(STATUS "[vix_orm] deps mode : standalone (no fetch)")
212269
endif()
213270
endif()
271+
message(STATUS "[vix_orm] examples : ${VIX_ORM_BUILD_EXAMPLES}")
272+
message(STATUS "[vix_orm] tests : ${VIX_ORM_BUILD_TESTS}")
214273
message(STATUS "------------------------------------------------------")

0 commit comments

Comments
 (0)