sqlxgentools/README.md

52 lines
1.6 KiB
Markdown
Raw Normal View History

2024-12-27 23:05:15 +01:00
# [WIP] sqlxgentools
2026-01-13 21:41:03 +01:00
Little tool to generate SQLite migrations files and Rust SQLx repositories code, all from models structs.
2024-12-27 23:05:15 +01:00
2026-01-13 21:41:03 +01:00
Still very much work in progress, but it can be already used in your next Rust app if you don't mind some limitations like the lack of incremental migrations and little quirks here and there.
## Getting started
- [Quick start tutorial](./docs/tutorials/quick_start.md)
2024-12-27 23:05:15 +01:00
## Project context
### Goals
- Help developers that dont use ORM and use SQLx in a Rust project with a SQLite DB.
- Auto generate boilerplate repositories pattern code
- Auto generate CREATE TABLE base migrations from model struct
- Auto generate Up and Down migrations
- Let developer have flexibility over the model definition
### Non-goals
- Provide a full a ORM interface
2026-01-13 21:41:03 +01:00
## Included crates
This project is split into 3 published crates.
- [`sqlxgentools_cli`](https://crates.io/crates/sqlxgentools_cli), used to parse, generate migrations and repositories.
- [`sqlxgentools_attrs`](https://crates.io/crates/sqlxgentools_attrs), provides proc macros.
- [`sqlxgentools_misc`](https://crates.io/crates/sqlxgentools_misc), provides data types and traits (optional).
2025-03-15 10:21:53 +01:00
## Features
- [x] generate migrations
- [x] from scratch
2026-01-13 21:41:03 +01:00
- [ ] incremental migration
2025-03-15 10:21:53 +01:00
- [ ] up migration
- [ ] down migration
- [x] generate repositories
- [x] get_all
- [x] get_by_id
- [x] insert
- [x] insert_many
2026-01-13 21:41:03 +01:00
- [x] custom get_by, get_many_by
- [x] get_many_of (from one-to-many relations)
2025-10-12 14:02:20 +02:00
2026-01-13 21:41:03 +01:00
## Contributions
2024-12-27 23:05:15 +01:00
2026-01-13 21:41:03 +01:00
Questions, remarks and contributions is very much welcomed.
2024-12-27 23:05:15 +01:00