Skip to content
Oxford Harrison edited this page Nov 15, 2024 · 5 revisions

DOCS


This is Linked QL's underlying persistent layer! It also functions as the administrative interface to Linked QL.

const linkedDB = await client.linkedDB();

Linked DB is automatically setup on your first relevant use of Linked QL.

Uninstallation

To completely erase all Linked QL and Linked QB footprints from your database, run the "uninstall" process:

await linkedDB.uninstall(true);

Re-installation happens automatically on first subsequent use of Linked QL.

Config

While the behaviour of Linked QL clients are configurable via ClientOptions, certain special behaviours must be determined at the database level for all clients. These are held in a persistent configuration system managed by Linked DB.

Here you set a config via either a two-parameter call pattern or a one-parameter call pattern:

await linkedDB.config('auto_savepoints', 0);
await linkedDB.config({ auto_savepoints: 0 });

And you read back these values either individually, or as a batch:

console.log(await linkedDB.config('auto_savepoints')); // 0
console.log(await linkedDB.config(['auto_savepoints', 'other'])); // { auto_savepoints: 0, other: ... }
console.log(await linkedDB.config()); // { auto_savepoints: 0, other: ... }

LinkedDBConfig

interface LinkedDBConfig {
    auto_savepoints?: number;
    require_client_ids?: number;
    require_commit_descs?: number;
    database_role?: string;
};
Param Interfaces Description
auto_savepoints? - An optional setting that controls Linked QL's automatic savepoints creation: Automatic Schema Versioning. Values: 0 | 1. Defaults to 1.
require_client_ids? - An optional setting that controls whether or not to require Linked QL client identifiers: ClientOptions.clientID. Values: 0 | 1. Defaults to 0.
require_commit_descs? - An optional setting that controls whether or not to require DDL commit descriptions: QueryOptions.desc, RecommitOptions.desc, RollbackOptions.desc. Values: 0 | 1. Defaults to 0.
database_role? - An optional setting that lets Linked QL recognize your master database and prevent potentially-conflicting DDL operations on it. Values: 'master' | null. Defaults to null.
Clone this wiki locally