denoDB

denoDB

  • Docs
  • GitHub
  • Help

›Guides

Guides

  • Getting started
  • Connect to a database
  • Clients

    • Using MariaDB
    • Using MongoDB
    • Using MySQL
    • Using PostgreSQL
    • Using SQLite
  • Create models
  • Synchronize database
  • Query models
  • Transactions
  • Relationships

    • Foreign key
    • One-to-one
    • One-to-many
    • Many-to-many
  • Model events

API Reference

    Models

    • Data types
    • Field descriptors
    • Model methods
    • Model records

Connect to a database

Before going any further, you will need to connect to your database.

import { Database, YourDatabaseConnector } from 'https://deno.land/x/denodb/mod.ts';

// SQLite3Connector, MySQLConnector, PostgresConnector...
const connector = new YourDatabaseConnector({ ... });
const db = new Database(connector);

// If you need debug logs, set `debug` to `true`
const db = new Database(
  connector,
  debug: true,
);

Depending on the dialect, you might need different options:

  • Using MariaDB
  • Using MongoDB
  • Using MySQL
  • Using PostegreSQL
  • Using SQLite
Last updated on 4/18/2021 by eveningkid
← Getting startedUsing MariaDB →
Docs
Getting StartedAPI Reference
More
GitHubStar