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
10 stars 4 forks source link

Expanding Model Type Declarations #38

Open loganliffick opened 3 months ago

loganliffick commented 3 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 3 months ago

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

caleb-mabry commented 2 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