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

DOCS


Linked DB is Linked QL's underlying persistent layer! It also functions as an administrative interface to Linked QL. Some of that is what we cover here.

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

This interface is obtained as:

const linkedDB = await client.linkedDB();

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: ... }

See related ➞ linkedql config

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