interface Hyperdrive {
    connectionString: string;
    database: string;
    host: string;
    password: string;
    port: number;
    user: string;
    connect(): Socket;
}

Properties

connectionString: string

A valid DB connection string that can be passed straight into the typical client library/driver/ORM. This will typically be the easiest way to use Hyperdrive.

database: string
host: string
password: string
port: number
user: string

Methods

  • Connect directly to Hyperdrive as if it's your database, returning a TCP socket.

    Calling this method returns an idential socket to if you call connect("host:port") using the host and port fields from this object. Pick whichever approach works better with your preferred DB client library.

    Note that this socket is not yet authenticated -- it's expected that your code (or preferably, the client library of your choice) will authenticate using the information in this class's readonly fields.

    Returns Socket