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

Support `dialect` declaration for SQL composition #18

Closed Brayden closed 4 months ago

Brayden commented 4 months ago

Is your feature request related to a problem? Please describe. When the query builder is composing a runnable SQL statement, it will become imperative for the dialect of the destination engine to be known so we construct valid SQL statements.

Describe the solution you'd like By default, a dialect can be set by the initial Connection object. For example if you declare to use the Neon connection object, it could preset the dialect to "postgres"

You can explicitly set a dialect yourself.

const db = Outerbase(neon);
db.dialect = "postgres"

Support the following dialects:

type SQLDialect = "postgres" | "mysql" | "sqlite" | "mssql" | "sqlserver" | "oracle" | "mariadb";

Describe alternatives you've considered TBD

Additional context TBD