outerbase / sdk

Typescript ORM and automated model generation direct from your database schema. Supports Outerbase features for saved queries & AI.
https://outerbase.com
MIT License
12 stars 5 forks source link

Expanding Model Type Declarations #38

Open loganliffick opened 5 months ago

loganliffick commented 5 months ago

Describe the bug When generating models, certain type declarations are omitted, specifically noted with Date and number.

Please note: this may just be a SQLite issue.

To Reproduce

  1. Set up SQLite db in Outerbase
  2. Make sure you have a column set to number
  3. run sync-models in your app
  4. check ./models and see if column type shows correctly (if I'm correct, it won't)
Brayden commented 5 months ago

REF: https://github.com/outerbase/sdk/blob/main/src/generators/generate-models.ts#L158

caleb-mabry commented 4 months ago

One cool thing I've noticed here is how Sequelize has these identified as different objects when you use the DataTypes class. That allows for additional checks with specific dialects if you so want! https://github.com/sequelize/sequelize/blob/main/packages/core/src/abstract-dialect/data-types.ts