This commit is contained in:
Eden Kirin
2025-10-31 13:34:56 +01:00
commit da97fada0e
12 changed files with 427 additions and 0 deletions

52
CLAUDE.md Normal file
View File

@ -0,0 +1,52 @@
# Entity maker
## Description
Application connects to postgres database, inspects targeted table and creates:
- sqlalchemy table
- model
- filter
- load options
- repository
- manager
- factory
Generated source files are targeted for Python 3.13 using SQLAlchemy.
## Input parameters
Application have following command line parameters:
- optional db host - default `localhost`
- optional db port - default `5432`
- optional db name
- optional db schema - default `public`
- optional db user - default `postgres`
- optional db password - default `postgres`
- optional db table
- optional output directory
- optional entity name
When application starts, it will offer users to enter missing parameters from command line, using defaults as listed above. Save entered values in `~/.config/entity-maker` and use it for the next time.
Generated files are placed in specificied output directory, in subdirectory named after table name, but in sigular. Check naming section for details.
## Examples
Example sql table structure is located in `./example/cashbag_conforms.sql`.
Example output is located in `./example/cashbag_conform`.
## Naming example
Table name: `cashbag_conforms`.
Output subdirectory: `cashbag_conform`
Model name: `CashbagConform`
Filter name `CashbagConformFilter`
Load options name `CashbagConformLoadOptions`
Repository name `CashbagConformRepository`
Manager name `CashbagConformManager`
Factory name `CashbagConformFactory`
## Technologies used
This is command line application. Application is written in golang. Application needs to be run on Linux only, no need to support other operating systems. Make application output modern and colorful.