ApiLogicServer / ApiLogicServer-src

Create an executable project (API and Admin App) from a database or natural language prompt with 1 command, customize with declarative rules and Python in your IDE, containerize and deploy.
https://apilogicserver.github.io/Docs/
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

codegen render_column finds unexpected col with >1 #59

Open selamar opened 5 months ago

selamar commented 5 months ago

while creating app I get:

codegen render_column finds unexpected col with >1 fk:product_attribute.attribute_id

what's the matter? please add meaningful suggestions in error messages

selamar commented 5 months ago

ok found the message "compare schema to models.py". maybe should be more evident. case closed.

valhuber commented 5 months ago

@selamar Thanks for reporting this. Much appreciated.

I see the code that produces this message, but (it's adapted code) it is difficult to see the underlying issue. It obviously does not come up in our test databases.

Would you be able to supply the ddl for this database, or even just show the relevant tables? I would like to include it in our tests, and, for sure, improve the error message.

It appears you got around it.... what did you do? Is your project now running?

Thanks, Val

selamar commented 5 months ago

Hi Val. The original issue was caused by a column in the schema that had TWO foreign keys, I'm using a SQLite client that is not too clear. I corrected the schema and the issue was resolved. I had other issues caused by the fact that the generator appears to map NUMERIC columns to type "String" (and if you have decimals it chokes up the generator). I resolved marking all NUMERIC columns as REAL, that was correctly mapped to "Float" (I'm worried about rounding issue, though). All in all a great product, I'm learning. I am puzzled seeing so few subscribers...