import { Database } from "https://deno.land/x/denodb_esgi@1.0.15.1/lib/database.ts";
Database client which interacts with an external database instance.
Constructors
Properties
private
_connector: Connectorprivate
_dialect: DatabaseDialectprivate
_models: ModelSchema[]private
_queryBuilder: QueryBuilderMethods
_computeModelFieldMatchings(): { toClient: FieldMatchingTable; toDatabase: FieldMatchingTable; }
Compute field matchings tables for model usage.
link(models: ModelSchema[])
Associate all the required information for a model to connect to a database.
await db.link([Flight, Airport]);
query(query: QueryDescription): Promise<any>
Pass on any query to the database.
await db.query("SELECT * FROM `flights`");
sync(options?: SyncOptions)
Create the given models in the current database.
await db.sync({ drop: true });