SQLStyle

Documentation

Getting started

Create an account, configure the SQLStyle CLI, and open a local database through the SDK.

The SQLStyle SDK opens a local database while SQLStyle coordinates the writer, live replicas, and recovery.

SQLStyle does not publish an uptime commitment or claim a formal compliance certification. Keep an independent recovery path for critical data.

1. Create and authenticate an account

Create an account at sqlstyle.com/account. Then authenticate the CLI:

sqlstyle auth login
sqlstyle auth status

Browser login stores an account-scoped CLI credential in the selected local credential store. The web dashboard handles signup and billing; database, storage-profile, API-key, restore, and analytics workflows remain in the CLI.

2. Create service resources

Create a non-secret storage profile:

sqlstyle storage profiles create \
  --name production \
  --provider aws_s3 \
  --bucket app-dbh \
  --region us-east-1 \
  --access-key-id "$AWS_ACCESS_KEY_ID"

Create a logical database and a database-scoped runtime key:

sqlstyle database app/main create --write-allowance 100 \
  --storage-profile-id <profile-id>

sqlstyle keys create \
  --database app/main \
  --label application-runtime

The key command prints the secret once by default. Store it in the application’s secret manager.

3. Ship the runtime and SDK

A Node.js release is expected to pair the SDK package with the SQLStyle runtime:

app/
  node_modules/@sqlstyle/database/
  vendor/sqlstyle/
    include/sqlstyle.h
    lib/libsqlstyle.so.1

The SQLStyle artifact supplies ABI v2 through its uniquely named library. Keep the runtime and SDK on the same release-qualified version set.

4. Open the database

import { DatabaseSync } from "@sqlstyle/database";

const db = new DatabaseSync("app.db", {
  sqlstyle: {
    name: "app/main",
    apiKey: process.env.SQLSTYLE_API_KEY,
    storage: {
      secretAccessKey: process.env.SQLSTYLE_STORAGE_SECRET_ACCESS_KEY,
    },
  },
});

try {
  console.log(db.prepare("select authority from sqlstyle_status").get());
} finally {
  db.close();
}

DatabaseSync follows the synchronous node:sqlite shape. SQLStyle adds managed database configuration while statements and rows remain ordinary SQLite operations.

5. Check write authority

Query the SQL surface through the returned connection:

SELECT authority FROM sqlstyle_status;

Only held admits writes. Treat unheld as read-only.

Next steps