Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating Ada: Missing procedure to define a primary key #52

Open
fdesp87 opened this issue Oct 26, 2022 · 0 comments
Open

Generating Ada: Missing procedure to define a primary key #52

fdesp87 opened this issue Oct 26, 2022 · 0 comments

Comments

@fdesp87
Copy link

fdesp87 commented Oct 26, 2022

Note that not all primary keys are autoincrement, so for tables with primary keys that are not autoincrement, there is not way to define a new row, as it is nor possible to assign a value to the primary key field.

The solution is that the functions New_ include parameters for the primary key fields. That implies modifications to dborm.py, which is in python, a surprise as this is Ada generating Ada. In the indicated github path an full Ada solution is included, replacing the python module.

The documentation is also misleading. It is indicated that it is highly recommended to set a primary key on all tables, also recommending using integers for such primary keys for efficiency reasons (i. e. autoincrement). This is not an accurate description: it must say that tables having non-autoincrement primary keys cannot be expanded (using gnatcoll-db) with new rows as the generated Ada code do not include routines to define new rows in these cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant