undiorm
v0.0.101
Published
Lightweight PG Orm
Downloads
19
Readme
About The Project
A PostgreSQL ORM created to scaffold large-scale and advanced databases.
Currently only supports basic ORM functionalities, planning on added advanced features, such as multi-tenant support and trigger functions.
I am documenting the whole process of creating the package on twitter.
Getting Started
Installation
Coming Soon – Not yet production ready
Usage
List of all the currently supported commands.
# Initialise a new, empty configuration
init
# Generate new migration
migration:generate <migration name>
# Create empty migration
migration:create <migration name>
# Run all available migrations
migration:run
# Revert database to the selected migration
migration:revert
# Create a new, empty entity
entity:create
# Generated the types for the currently synced entities
types:generate
Examples
The repo contains an example folder - feel free to clone and play around with it; as always, suggetions are more than welcome.
Roadmap
- ORM
- [ ] CLI
- [x] Create new, empty entity
- [x] Create new, empty migration
- [x] Generate migration based on entity changes
- [x] Run all available migrations
- [x] Revert to a specific migration
- [ ] Handle other object depend on error when trying to replace a column which is used by a view
- [ ] Drop migrations
- [ ] Drop last migration
- [x] Incremental migrations
- [x] Keywords in default
- [x] Indices
- [ ] Autogenerate table names (pluralize)
- [x] Handle primary keys
- [ ] Orm configs
- [x] js/ts support
- [x] json support
- [ ] xml support
- [ ] yml support
- [ ] .env support
- [ ] Plugin manager
- [ ] Enum support
- [ ] Foreign key support
- [ ] Relation support
- [x] View support
- [ ] Add 'with check' option
- [ ] Function support
- [ ] Trigger support
- [x] Add
onInsert.set
- [x] Add
onUpdate.set
- [x] Add
onDelete.set
- [x] Add
beforeInsert
procedure SQL code - [x] Add
beforeUpdate
procedure SQL code - [x] Add
beforeDelete
procedure SQL code - [ ] Add
preventDefault
logic - [ ] Add conditional logic
- [x] Add
- [ ] GIS Support
- [ ] Convert codebase to classes for easier maintenance
- [ ] Handle naming conventions
- [ ] Add warnings to operations with potential data loss
- [ ] Add
pull
command
- [ ] CLI
- Query Builder
- Graphql Types
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Balazs Szalay - @szalayme - [email protected]