\n \n ```\n\n3. Create the JavaScript file (load_extension.js) that initializes the SQLite WASM worker and verifies the extension is loaded:\n\n ```javascript\n /**\n * This example uses the package `@sqliteai/sqlite-wasm`.\n * This version of SQLite WASM is bundled with SQLite Sync and SQLite Vector extensions.\n * Extensions cannot be loaded at runtime in the browser environment.\n * \n * Run: `npx serve .`\n */\n\n import { sqlite3Worker1Promiser } from '@sqliteai/sqlite-wasm';\n\n const log = console.log;\n const error = console.error;\n\n const initializeSQLite = async () => {\n try {\n log('Loading and initializing SQLite3 module with sqlite-sync extension...');\n\n const promiser = await new Promise((resolve) => {\n const _promiser = sqlite3Worker1Promiser({\n onready: () => resolve(_promiser),\n });\n });\n\n const configResponse = await promiser('config-get', {});\n log('Running SQLite3 version', configResponse.result.version.libVersion);\n\n const openResponse = await promiser('open', {\n filename: 'file:mydb.sqlite3',\n });\n const { dbId } = openResponse;\n \n await promiser('exec', { \n dbId, \n sql: 'SELECT cloudsync_version();', // or vector_version()\n callback: (result) => {\n if (!result.row) {\n return;\n }\n log('Include SQLite Sync version: ', result.row[0]);\n }\n });\n\n } catch (err) {\n if (!(err instanceof Error)) {\n err = new Error(err.result.message);\n }\n error(err.name, err.message);\n }\n };\n\n initializeSQLite();\n ```\n\n## Usage Example\n\nCheck out the React/Vite app for a complete implementation of using the SQLite CloudSync extension to sync data across devices.","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/quick-starts/wasm.md","digest":"b78bdb4a54310fbd","rendered":{"html":"
    \n
  1. \n

    Install the WebAssembly (WASM) version of SQLite with the SQLite Sync extension enabled from npm:

    \n
    npm install @sqliteai/sqlite-wasm
    \n
  2. \n
  3. \n

    Create an HTML file that imports the SQLite WASM module using an import map and references the JavaScript loader:

    \n
    <!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>SQLite WASM Extension Example</title>\n</head>\n<body>\n    <h1>SQLite WASM with SQLite Sync Example</h1>\n    <p>Open the directory in the terminal and type: <code>npx serve .</code></p>\n    <p>Check the browser console for output.</p>\n    \n    <script type=\"importmap\">\n    {\n        \"imports\": {\n        \"@sqliteai/sqlite-wasm\": \"./node_modules/@sqliteai/sqlite-wasm/index.mjs\"\n        }\n    }\n    </script>\n    <script type=\"module\" src=\"load_extension.js\"></script>\n</body>\n</html>
    \n
  4. \n
  5. \n

    Create the JavaScript file (load_extension.js) that initializes the SQLite WASM worker and verifies the extension is loaded:

    \n
    /**\n* This example uses the package `@sqliteai/sqlite-wasm`.\n* This version of SQLite WASM is bundled with SQLite Sync and SQLite Vector extensions.\n* Extensions cannot be loaded at runtime in the browser environment.\n* \n* Run: `npx serve .`\n*/\n\nimport { sqlite3Worker1Promiser } from '@sqliteai/sqlite-wasm';\n\nconst log = console.log;\nconst error = console.error;\n\nconst initializeSQLite = async () => {\ntry {\n    log('Loading and initializing SQLite3 module with sqlite-sync extension...');\n\n    const promiser = await new Promise((resolve) => {\n    const _promiser = sqlite3Worker1Promiser({\n        onready: () => resolve(_promiser),\n    });\n    });\n\n    const configResponse = await promiser('config-get', {});\n    log('Running SQLite3 version', configResponse.result.version.libVersion);\n\n    const openResponse = await promiser('open', {\n    filename: 'file:mydb.sqlite3',\n    });\n    const { dbId } = openResponse;\n    \n    await promiser('exec', { \n        dbId, \n        sql: 'SELECT cloudsync_version();', // or vector_version()\n        callback: (result) => {\n            if (!result.row) {\n                return;\n            }\n            log('Include SQLite Sync version: ', result.row[0]);\n        }\n    });\n\n} catch (err) {\n    if (!(err instanceof Error)) {\n    err = new Error(err.result.message);\n    }\n    error(err.name, err.message);\n}\n};\n\ninitializeSQLite();
    \n
  6. \n
\n

Usage Example

\n

Check out the React/Vite app for a complete implementation of using the SQLite CloudSync extension to sync data across devices.

","metadata":{"headings":[{"depth":2,"slug":"usage-example","text":"Usage Example"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"WASM Quick Start Guide","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-quick-start-wasm"},"imagePaths":[]}},"collection":"docs"}},{"title":"Windows","filePath":"sqlite-sync-quick-start-windows","type":"inner","level":2,"entry":{"id":"sqlite-sync-quick-start-windows","data":{"title":"Windows Quick Start","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"This guide explains how to install SQLite on Windows with support for loading extensions.\n\n## Using SQLite with Python\n\n1. **Download Python** \n\n Get the latest Python for Windows from python.org.\n\n2. **Install Python**\n\n - Run the installer.\n - Make sure to check **\"Add Python to PATH\"**.\n - SQLite comes bundled with Python, no extra steps needed.\n\n3. **Check your installation** \n Open Command Prompt and run:\n\n ```bash\n python --version\n python -c \"import sqlite3; print('SQLite version:', sqlite3.sqlite_version)\"\n ```\n\n4. **Download the Extension**\n\n Go to sqlite-sync releases and download the extension.\n\n5. **Load Extension**\n ```python\n import sqlite3\n import os\n\n # Path to your compiled extension (.dll for Windows)\n EXTENSION_PATH = os.path.abspath(\"cloudsync\")\n\n # Connect to SQLite and enable extension loading\n conn = sqlite3.connect(\":memory:\")\n conn.enable_load_extension(True)\n\n # Load the extension\n try:\n conn.load_extension(EXTENSION_PATH)\n print(\"Extension loaded successfully.\")\n except sqlite3.OperationalError as e:\n print(f\"Failed to load extension: {e}\")\n\n conn.enable_load_extension(False)\n\n # Optionally test it (e.g., call a custom SQL function)\n cursor = conn.execute(\"SELECT cloudsync_version();\")\n print(cursor.fetchone())\n ```\n\n## Using SQLite with C#\n\nThis guide shows how to load a native SQLite extension (e.g., **`cloudsync.dll`**) from a C# app on **Windows** using **`Microsoft.Data.Sqlite`**.\n\n### Prerequisites\n\n- Windows x64\n- .NET 6+ SDK\n- NuGet package manager\n- The native extension file: `cloudsync.dll` (x64 build) - download from sqlite-sync releases\n\n> **Important:** Your app, `e_sqlite3.dll` (bundled by `Microsoft.Data.Sqlite`), and `cloudsync.dll` must all be the **same architecture** (typically x64).\n\n---\n\n### 1. Install the SQLite package\n\nInstall the `Microsoft.Data.Sqlite` NuGet package:\n\n```bash\ndotnet add package Microsoft.Data.Sqlite\n```\n\n### 2. Set up your project structure\n\nPlace `cloudsync.dll` in your project and configure it to copy to the output folder.\n\nExample directory structure:\n\n```\nMyApp/\n Program.cs\n Native/\n cloudsync.dll\n MyApp.csproj\n```\n\nConfigure your `MyApp.csproj` file:\n\n```xml\n\n \n Exe\n net8.0\n enable\n enable\n \n\n \n \n \n\n \n \n \n PreserveNewest\n \n \n\n```\n\n### 3. Load the extension in your code\n\nCreate your `Program.cs` file to initialize SQLite and load the extension:\n\n```csharp\nusing System;\nusing Microsoft.Data.Sqlite;\n\nclass Program\n{\n static void Main()\n {\n // Configure the database connection\n var cs = new SqliteConnectionStringBuilder\n {\n DataSource = \"example.db\",\n Mode = SqliteOpenMode.ReadWriteCreate\n }.ToString();\n\n using var conn = new SqliteConnection(cs);\n conn.Open();\n\n // Enable extension loading\n conn.EnableExtensions();\n\n // Load the native extension (DLL must be next to the EXE or on PATH)\n // You can pass an absolute path if you prefer\n conn.LoadExtension(\"cloudsync\");\n\n // Verify SQLite is working\n using var cmd = conn.CreateCommand();\n cmd.CommandText = \"SELECT sqlite_version();\";\n Console.WriteLine(\"SQLite version: \" + cmd.ExecuteScalar());\n\n // Verify the extension is loaded\n cmd.CommandText = \"SELECT cloudsync_version();\";\n Console.WriteLine(\"cloudsync_version(): \" + cmd.ExecuteScalar());\n }\n}\n```\n\n### 4. Run your application\n\nBuild and run your application:\n\n```bash\ndotnet build\ndotnet run\n```\n\nYou should see output similar to:\n\n```\nSQLite version: 3.45.0\ncloudsync_version(): 1.0.0\n```\n\n#### Extension search locations\n\nSQLite searches for extensions in this order:\n\n1. Process working directory\n2. Application base directory (where your .exe lives)\n3. PATH environment variable directories\n4. Full path provided to `LoadExtension(...)`\n\n> **Tip:** For most apps, simply copying the DLL to the output folder (next to your .exe) is sufficient.\n\n---\n\n### Common issues and solutions\n\n**SqliteException: not authorized**\n\n- **Cause:** Extension loading not enabled\n- **Fix:** Call `conn.EnableExtensions()` before loading\n\n**SqliteException: The specified module could not be found**\n\n- **Cause:** DLL not in search path or missing dependencies\n- **Fix:** Place DLL next to .exe, use absolute path, or ensure dependencies are available\n\n**BadImageFormatException**\n\n- **Cause:** Architecture mismatch (e.g., mixing x86 and x64)\n- **Fix:** Ensure app, `e_sqlite3.dll`, and `cloudsync.dll` are all the same architecture\n\n**EntryPointNotFoundException**\n\n- **Cause:** DLL is not a valid SQLite extension\n- **Fix:** Verify the extension exports `sqlite3_extension_init`\n\n**Windows \"blocked\" DLL**\n\n- **Cause:** Downloaded DLL is blocked by Windows\n- **Fix:** Right-click → Properties → Check \"Unblock\" → OK\n\n---\n\n### Deployment\n\nWhen publishing your app, ensure the extension is included:\n\n```bash\ndotnet publish -c Release -r win-x64 --self-contained false\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/quick-starts/windows.md","digest":"de0b1b6a2f4cb08f","rendered":{"html":"

This guide explains how to install SQLite on Windows with support for loading extensions.

\n

Using SQLite with Python

\n
    \n
  1. \n

    Download Python

    \n

    Get the latest Python for Windows from python.org.

    \n
  2. \n
  3. \n

    Install Python

    \n
      \n
    • Run the installer.
    • \n
    • Make sure to check “Add Python to PATH”.
    • \n
    • SQLite comes bundled with Python, no extra steps needed.
    • \n
    \n
  4. \n
  5. \n

    Check your installation
    \nOpen Command Prompt and run:

    \n
  6. \n
\n
python --version\npython -c \"import sqlite3; print('SQLite version:', sqlite3.sqlite_version)\"
\n
    \n
  1. \n

    Download the Extension

    \n

    Go to sqlite-sync releases and download the extension.

    \n
  2. \n
  3. \n

    Load Extension

    \n
  4. \n
\n
import sqlite3\nimport os\n\n# Path to your compiled extension (.dll for Windows)\nEXTENSION_PATH = os.path.abspath(\"cloudsync\")\n\n# Connect to SQLite and enable extension loading\nconn = sqlite3.connect(\":memory:\")\nconn.enable_load_extension(True)\n\n# Load the extension\ntry:\n    conn.load_extension(EXTENSION_PATH)\n    print(\"Extension loaded successfully.\")\nexcept sqlite3.OperationalError as e:\n    print(f\"Failed to load extension: {e}\")\n\nconn.enable_load_extension(False)\n\n# Optionally test it (e.g., call a custom SQL function)\ncursor = conn.execute(\"SELECT cloudsync_version();\")\nprint(cursor.fetchone())
\n

Using SQLite with C#

\n

This guide shows how to load a native SQLite extension (e.g., cloudsync.dll) from a C# app on Windows using Microsoft.Data.Sqlite.

\n

Prerequisites

\n\n
\n

Important: Your app, e_sqlite3.dll (bundled by Microsoft.Data.Sqlite), and cloudsync.dll must all be the same architecture (typically x64).

\n
\n
\n

1. Install the SQLite package

\n

Install the Microsoft.Data.Sqlite NuGet package:

\n
dotnet add package Microsoft.Data.Sqlite
\n

2. Set up your project structure

\n

Place cloudsync.dll in your project and configure it to copy to the output folder.

\n

Example directory structure:

\n
MyApp/\n  Program.cs\n  Native/\n    cloudsync.dll\n  MyApp.csproj
\n

Configure your MyApp.csproj file:

\n
<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8.0</TargetFramework>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Data.Sqlite\" Version=\"8.*\" />\n  </ItemGroup>\n\n  <!-- Copy native extension to build output -->\n  <ItemGroup>\n    <None Include=\"Native\\cloudsync.dll\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n</Project>
\n

3. Load the extension in your code

\n

Create your Program.cs file to initialize SQLite and load the extension:

\n
using System;\nusing Microsoft.Data.Sqlite;\n\nclass Program\n{\n    static void Main()\n    {\n        // Configure the database connection\n        var cs = new SqliteConnectionStringBuilder\n        {\n            DataSource = \"example.db\",\n            Mode = SqliteOpenMode.ReadWriteCreate\n        }.ToString();\n\n        using var conn = new SqliteConnection(cs);\n        conn.Open();\n\n        // Enable extension loading\n        conn.EnableExtensions();\n\n        // Load the native extension (DLL must be next to the EXE or on PATH)\n        // You can pass an absolute path if you prefer\n        conn.LoadExtension(\"cloudsync\");\n\n        // Verify SQLite is working\n        using var cmd = conn.CreateCommand();\n        cmd.CommandText = \"SELECT sqlite_version();\";\n        Console.WriteLine(\"SQLite version: \" + cmd.ExecuteScalar());\n\n        // Verify the extension is loaded\n        cmd.CommandText = \"SELECT cloudsync_version();\";\n        Console.WriteLine(\"cloudsync_version(): \" + cmd.ExecuteScalar());\n    }\n}
\n

4. Run your application

\n

Build and run your application:

\n
dotnet build\ndotnet run
\n

You should see output similar to:

\n
SQLite version: 3.45.0\ncloudsync_version(): 1.0.0
\n

Extension search locations

\n

SQLite searches for extensions in this order:

\n
    \n
  1. Process working directory
  2. \n
  3. Application base directory (where your .exe lives)
  4. \n
  5. PATH environment variable directories
  6. \n
  7. Full path provided to LoadExtension(...)
  8. \n
\n
\n

Tip: For most apps, simply copying the DLL to the output folder (next to your .exe) is sufficient.

\n
\n
\n

Common issues and solutions

\n

SqliteException: not authorized

\n
    \n
  • Cause: Extension loading not enabled
  • \n
  • Fix: Call conn.EnableExtensions() before loading
  • \n
\n

SqliteException: The specified module could not be found

\n
    \n
  • Cause: DLL not in search path or missing dependencies
  • \n
  • Fix: Place DLL next to .exe, use absolute path, or ensure dependencies are available
  • \n
\n

BadImageFormatException

\n
    \n
  • Cause: Architecture mismatch (e.g., mixing x86 and x64)
  • \n
  • Fix: Ensure app, e_sqlite3.dll, and cloudsync.dll are all the same architecture
  • \n
\n

EntryPointNotFoundException

\n
    \n
  • Cause: DLL is not a valid SQLite extension
  • \n
  • Fix: Verify the extension exports sqlite3_extension_init
  • \n
\n

Windows “blocked” DLL

\n
    \n
  • Cause: Downloaded DLL is blocked by Windows
  • \n
  • Fix: Right-click → Properties → Check “Unblock” → OK
  • \n
\n
\n

Deployment

\n

When publishing your app, ensure the extension is included:

\n
dotnet publish -c Release -r win-x64 --self-contained false
","metadata":{"headings":[{"depth":2,"slug":"using-sqlite-with-python","text":"Using SQLite with Python"},{"depth":2,"slug":"using-sqlite-with-c","text":"Using SQLite with C#"},{"depth":3,"slug":"prerequisites","text":"Prerequisites"},{"depth":3,"slug":"1-install-the-sqlite-package","text":"1. Install the SQLite package"},{"depth":3,"slug":"2-set-up-your-project-structure","text":"2. Set up your project structure"},{"depth":3,"slug":"3-load-the-extension-in-your-code","text":"3. Load the extension in your code"},{"depth":3,"slug":"4-run-your-application","text":"4. Run your application"},{"depth":4,"slug":"extension-search-locations","text":"Extension search locations"},{"depth":3,"slug":"common-issues-and-solutions","text":"Common issues and solutions"},{"depth":3,"slug":"deployment","text":"Deployment"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"Windows Quick Start","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-quick-start-windows"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_init","filePath":"sqlite-sync-api-cloudsync-init","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-init","data":{"title":"cloudsync_init(table_name, [crdt_algo], [force])","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Initializes a table for `sqlite-sync` synchronization. This function is idempotent and needs to be called only once per table on each site; configurations are stored in the database and automatically loaded with the extension.\n\nBefore initialization, `cloudsync_init` performs schema sanity checks to ensure compatibility with CRDT requirements and best practices. These checks include:\n\n- Primary keys should not be auto-incrementing integers; GUIDs (UUIDs, ULIDs) are highly recommended to prevent multi-node collisions.\n- All primary key columns must be `NOT NULL`.\n- All non-primary key `NOT NULL` columns must have a `DEFAULT` value.\n\n**Schema Design Considerations:**\n\nWhen designing your database schema for SQLite Sync, follow these essential requirements:\n\n- **Primary Keys**: Use TEXT primary keys with `cloudsync_uuid()` for globally unique identifiers. Avoid auto-incrementing integers.\n- **Column Constraints**: All NOT NULL columns (except primary keys) must have DEFAULT values to prevent synchronization errors.\n- **UNIQUE Constraints**: In multi-tenant scenarios, use composite UNIQUE constraints (e.g., `UNIQUE(tenant_id, email)`) instead of global uniqueness.\n- **Foreign Key Compatibility**: Be aware of potential conflicts during CRDT merge operations and RLS policy interactions.\n- **Trigger Compatibility**: Triggers may cause duplicate operations or be called multiple times due to column-by-column processing.\n\nFor comprehensive guidelines, see the [Database Schema Recommendations](/docs/sqlite-sync-best-practices) section.\n\nThe function supports three overloads:\n\n- `cloudsync_init(table_name)`: Uses the default 'cls' CRDT algorithm.\n- `cloudsync_init(table_name, crdt_algo)`: Specifies a CRDT algorithm ('cls', 'dws', 'aws', 'gos').\n- `cloudsync_init(table_name, crdt_algo, force)`: Specifies an algorithm and, if `force` is `true` (or `1`), skips the integer primary key check (use with caution, GUIDs are strongly recommended).\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table to initialize.\n- `crdt_algo` (TEXT, optional): The CRDT algorithm to use. Can be \"cls\", \"dws\", \"aws\", \"gos\". Defaults to \"cls\".\n- `force` (BOOLEAN, optional): If `true` (or `1`), it skips the check that prevents the use of a single-column INTEGER primary key. Defaults to `false`. It is strongly recommended to use globally unique primary keys instead of integers.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\n-- Initialize a single table for synchronization with the Causal-Length Set (CLS) Algorithm (default)\nSELECT cloudsync_init('my_table');\n\n-- Initialize a single table for synchronization with a different algorithm Delete-Wins Set (DWS)\nSELECT cloudsync_init('my_table', 'dws');\n\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_init.md","digest":"91bbc816852ec9b0","rendered":{"html":"

Description: Initializes a table for sqlite-sync synchronization. This function is idempotent and needs to be called only once per table on each site; configurations are stored in the database and automatically loaded with the extension.

\n

Before initialization, cloudsync_init performs schema sanity checks to ensure compatibility with CRDT requirements and best practices. These checks include:

\n
    \n
  • Primary keys should not be auto-incrementing integers; GUIDs (UUIDs, ULIDs) are highly recommended to prevent multi-node collisions.
  • \n
  • All primary key columns must be NOT NULL.
  • \n
  • All non-primary key NOT NULL columns must have a DEFAULT value.
  • \n
\n

Schema Design Considerations:

\n

When designing your database schema for SQLite Sync, follow these essential requirements:

\n
    \n
  • Primary Keys: Use TEXT primary keys with cloudsync_uuid() for globally unique identifiers. Avoid auto-incrementing integers.
  • \n
  • Column Constraints: All NOT NULL columns (except primary keys) must have DEFAULT values to prevent synchronization errors.
  • \n
  • UNIQUE Constraints: In multi-tenant scenarios, use composite UNIQUE constraints (e.g., UNIQUE(tenant_id, email)) instead of global uniqueness.
  • \n
  • Foreign Key Compatibility: Be aware of potential conflicts during CRDT merge operations and RLS policy interactions.
  • \n
  • Trigger Compatibility: Triggers may cause duplicate operations or be called multiple times due to column-by-column processing.
  • \n
\n

For comprehensive guidelines, see the Database Schema Recommendations section.

\n

The function supports three overloads:

\n
    \n
  • cloudsync_init(table_name): Uses the default ‘cls’ CRDT algorithm.
  • \n
  • cloudsync_init(table_name, crdt_algo): Specifies a CRDT algorithm (‘cls’, ‘dws’, ‘aws’, ‘gos’).
  • \n
  • cloudsync_init(table_name, crdt_algo, force): Specifies an algorithm and, if force is true (or 1), skips the integer primary key check (use with caution, GUIDs are strongly recommended).
  • \n
\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table to initialize.
  • \n
  • crdt_algo (TEXT, optional): The CRDT algorithm to use. Can be “cls”, “dws”, “aws”, “gos”. Defaults to “cls”.
  • \n
  • force (BOOLEAN, optional): If true (or 1), it skips the check that prevents the use of a single-column INTEGER primary key. Defaults to false. It is strongly recommended to use globally unique primary keys instead of integers.
  • \n
\n

Returns: None.

\n

Example:

\n
-- Initialize a single table for synchronization with the Causal-Length Set (CLS) Algorithm (default)\nSELECT cloudsync_init('my_table');\n\n-- Initialize a single table for synchronization with a different algorithm Delete-Wins Set (DWS)\nSELECT cloudsync_init('my_table', 'dws');\n
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_init(table_name, [crdt_algo], [force])","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-init"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_enable","filePath":"sqlite-sync-api-cloudsync-enable","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-enable","data":{"title":"cloudsync_enable(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Enables synchronization for the specified table.\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table to enable.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_enable('my_table');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_enable.md","digest":"e40de2f66cb0c9fb","rendered":{"html":"

Description: Enables synchronization for the specified table.

\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table to enable.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_enable('my_table');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_enable(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-enable"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_disable","filePath":"sqlite-sync-api-cloudsync-disable","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-disable","data":{"title":"cloudsync_disable(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Disables synchronization for the specified table.\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table to disable.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_disable('my_table');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_disable.md","digest":"5d39cdb248653edc","rendered":{"html":"

Description: Disables synchronization for the specified table.

\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table to disable.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_disable('my_table');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_disable(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-disable"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_is_enabled","filePath":"sqlite-sync-api-cloudsync-is-enabled","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-is-enabled","data":{"title":"cloudsync_is_enabled(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Checks if synchronization is enabled for the specified table.\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table to check.\n\n**Returns:** 1 if enabled, 0 otherwise.\n\n**Example:**\n\n```sql\nSELECT cloudsync_is_enabled('my_table');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_is_enabled.md","digest":"39a063e10885d15c","rendered":{"html":"

Description: Checks if synchronization is enabled for the specified table.

\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table to check.
  • \n
\n

Returns: 1 if enabled, 0 otherwise.

\n

Example:

\n
SELECT cloudsync_is_enabled('my_table');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_is_enabled(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-is-enabled"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_cleanup","filePath":"sqlite-sync-api-cloudsync-cleanup","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-cleanup","data":{"title":"cloudsync_cleanup(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Removes the `sqlite-sync` synchronization mechanism from a specified table or all tables. This operation drops the associated `_cloudsync` metadata table and removes triggers from the target table(s). Use this function when synchronization is no longer desired for a table.\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table to clean up.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\n-- Clean up a single table\nSELECT cloudsync_cleanup('my_table');\n\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_cleanup.md","digest":"34af6835f8c0f273","rendered":{"html":"

Description: Removes the sqlite-sync synchronization mechanism from a specified table or all tables. This operation drops the associated _cloudsync metadata table and removes triggers from the target table(s). Use this function when synchronization is no longer desired for a table.

\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table to clean up.
  • \n
\n

Returns: None.

\n

Example:

\n
-- Clean up a single table\nSELECT cloudsync_cleanup('my_table');\n
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_cleanup(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-cleanup"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_terminate","filePath":"sqlite-sync-api-cloudsync-terminate","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-terminate","data":{"title":"cloudsync_terminate()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Releases all internal resources used by the `sqlite-sync` extension for the current database connection. This function should be called before closing the database connection to ensure that all prepared statements and allocated memory are freed. Failing to call this function can result in memory leaks or a failed `sqlite3_close` operation due to pending statements.\n\n**Parameters:** None.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\n-- Before closing the database connection\nSELECT cloudsync_terminate();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_terminate.md","digest":"61605cf92ba40fe3","rendered":{"html":"

Description: Releases all internal resources used by the sqlite-sync extension for the current database connection. This function should be called before closing the database connection to ensure that all prepared statements and allocated memory are freed. Failing to call this function can result in memory leaks or a failed sqlite3_close operation due to pending statements.

\n

Parameters: None.

\n

Returns: None.

\n

Example:

\n
-- Before closing the database connection\nSELECT cloudsync_terminate();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_terminate()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-terminate"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_version","filePath":"sqlite-sync-api-cloudsync-version","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-version","data":{"title":"cloudsync_version()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Returns the version of the `sqlite-sync` library.\n\n**Parameters:** None.\n\n**Returns:** The library version as a string.\n\n**Example:**\n\n```sql\nSELECT cloudsync_version();\n-- e.g., '1.0.0'\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_version.md","digest":"5c06f4566e987637","rendered":{"html":"

Description: Returns the version of the sqlite-sync library.

\n

Parameters: None.

\n

Returns: The library version as a string.

\n

Example:

\n
SELECT cloudsync_version();\n-- e.g., '1.0.0'
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_version()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-version"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_siteid","filePath":"sqlite-sync-api-cloudsync-siteid","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-siteid","data":{"title":"cloudsync_siteid()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Returns the unique ID of the local site.\n\n**Parameters:** None.\n\n**Returns:** The site ID as a BLOB.\n\n**Example:**\n\n```sql\nSELECT cloudsync_siteid();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_siteid.md","digest":"248b6f7d2d618e52","rendered":{"html":"

Description: Returns the unique ID of the local site.

\n

Parameters: None.

\n

Returns: The site ID as a BLOB.

\n

Example:

\n
SELECT cloudsync_siteid();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_siteid()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-siteid"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_db_version","filePath":"sqlite-sync-api-cloudsync-db-version","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-db-version","data":{"title":"cloudsync_db_version()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Returns the current database version.\n\n**Parameters:** None.\n\n**Returns:** The database version as an INTEGER.\n\n**Example:**\n\n```sql\nSELECT cloudsync_db_version();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_db_version.md","digest":"dbcb50e1a589e1f0","rendered":{"html":"

Description: Returns the current database version.

\n

Parameters: None.

\n

Returns: The database version as an INTEGER.

\n

Example:

\n
SELECT cloudsync_db_version();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_db_version()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-db-version"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_uuid","filePath":"sqlite-sync-api-cloudsync-uuid","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-uuid","data":{"title":"cloudsync_uuid()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Generates a new universally unique identifier (UUIDv7). This is useful for creating globally unique primary keys for new records, which is a best practice for CRDTs.\n\n**Parameters:** None.\n\n**Returns:** A new UUID as a TEXT value.\n\n**Example:**\n\n```sql\nINSERT INTO products (id, name) VALUES (cloudsync_uuid(), 'New Product');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_uuid.md","digest":"050e3d3541fa3a46","rendered":{"html":"

Description: Generates a new universally unique identifier (UUIDv7). This is useful for creating globally unique primary keys for new records, which is a best practice for CRDTs.

\n

Parameters: None.

\n

Returns: A new UUID as a TEXT value.

\n

Example:

\n
INSERT INTO products (id, name) VALUES (cloudsync_uuid(), 'New Product');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_uuid()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-uuid"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_begin_alter","filePath":"sqlite-sync-api-cloudsync-begin-alter","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-begin-alter","data":{"title":"cloudsync_begin_alter(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Prepares a synchronized table for schema changes. This function must be called before altering the table. Failure to use `cloudsync_begin_alter` and `cloudsync_commit_alter` can lead to synchronization errors and data divergence.\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table that will be altered.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_init('my_table');\n-- ... later\nSELECT cloudsync_begin_alter('my_table');\nALTER TABLE my_table ADD COLUMN new_column TEXT;\nSELECT cloudsync_commit_alter('my_table');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_begin_alter.md","digest":"0ac164f0c60c7c64","rendered":{"html":"

Description: Prepares a synchronized table for schema changes. This function must be called before altering the table. Failure to use cloudsync_begin_alter and cloudsync_commit_alter can lead to synchronization errors and data divergence.

\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table that will be altered.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_init('my_table');\n-- ... later\nSELECT cloudsync_begin_alter('my_table');\nALTER TABLE my_table ADD COLUMN new_column TEXT;\nSELECT cloudsync_commit_alter('my_table');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_begin_alter(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-begin-alter"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_commit_alter","filePath":"sqlite-sync-api-cloudsync-commit-alter","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-commit-alter","data":{"title":"cloudsync_commit_alter(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Finalizes schema changes for a synchronized table. This function must be called after altering the table's schema, completing the process initiated by `cloudsync_begin_alter` and ensuring CRDT data consistency.\n\n**Parameters:**\n\n- `table_name` (TEXT): The name of the table that was altered.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_init('my_table');\n-- ... later\nSELECT cloudsync_begin_alter('my_type');\nALTER TABLE my_table ADD COLUMN new_column TEXT;\nSELECT cloudsync_commit_alter('my_table');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_commit_alter.md","digest":"c730e139913d4f5c","rendered":{"html":"

Description: Finalizes schema changes for a synchronized table. This function must be called after altering the table’s schema, completing the process initiated by cloudsync_begin_alter and ensuring CRDT data consistency.

\n

Parameters:

\n
    \n
  • table_name (TEXT): The name of the table that was altered.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_init('my_table');\n-- ... later\nSELECT cloudsync_begin_alter('my_type');\nALTER TABLE my_table ADD COLUMN new_column TEXT;\nSELECT cloudsync_commit_alter('my_table');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_commit_alter(table_name)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-commit-alter"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_init","filePath":"sqlite-sync-api-cloudsync-network-init","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-init","data":{"title":"cloudsync_network_init(connection_string)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Initializes the `sqlite-sync` network component. This function parses the connection string to configure change checking and upload endpoints, and initializes the cURL library.\n\n**Parameters:**\n\n- `connection_string` (TEXT): The connection string for the remote synchronization server. The format is `sqlitecloud://:/?`.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_init('.sqlite.cloud/.sqlite');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_init.md","digest":"2f36cb9fccac010f","rendered":{"html":"

Description: Initializes the sqlite-sync network component. This function parses the connection string to configure change checking and upload endpoints, and initializes the cURL library.

\n

Parameters:

\n
    \n
  • connection_string (TEXT): The connection string for the remote synchronization server. The format is sqlitecloud://<host>:<port>/<database>?<options>.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_init('<projectid>.sqlite.cloud/<db>.sqlite');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_init(connection_string)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-init"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_cleanup","filePath":"sqlite-sync-api-cloudsync-network-cleanup","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-cleanup","data":{"title":"cloudsync_network_cleanup()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Cleans up the `sqlite-sync` network component, releasing all resources allocated by `cloudsync_network_init` (memory, cURL handles).\n\n**Parameters:** None.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_cleanup();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_cleanup.md","digest":"98fe3dabab8b2fea","rendered":{"html":"

Description: Cleans up the sqlite-sync network component, releasing all resources allocated by cloudsync_network_init (memory, cURL handles).

\n

Parameters: None.

\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_cleanup();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_cleanup()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-cleanup"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_set_token","filePath":"sqlite-sync-api-cloudsync-network-set-token","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-set-token","data":{"title":"cloudsync_network_set_token(token)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Sets the authentication token to be used for network requests. This token will be included in the `Authorization` header of all subsequent requests. For more information, refer to the [Access Tokens documentation](/docs/access-tokens).\n\n**Parameters:**\n\n- `token` (TEXT): The authentication token.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_set_token('your_auth_token');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_set_token.md","digest":"bf44980881bda060","rendered":{"html":"

Description: Sets the authentication token to be used for network requests. This token will be included in the Authorization header of all subsequent requests. For more information, refer to the Access Tokens documentation.

\n

Parameters:

\n
    \n
  • token (TEXT): The authentication token.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_set_token('your_auth_token');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_set_token(token)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-set-token"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_set_apikey","filePath":"sqlite-sync-api-cloudsync-network-set-apikey","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-set-apikey","data":{"title":"cloudsync_network_set_apikey(apikey)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Sets the API key for network requests. This key is included in the `Authorization` header of all subsequent requests.\n\n**Parameters:**\n\n- `apikey` (TEXT): The API key.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_set_apikey('your_api_key');\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_set_apikey.md","digest":"c4d83a90f2b9ca9a","rendered":{"html":"

Description: Sets the API key for network requests. This key is included in the Authorization header of all subsequent requests.

\n

Parameters:

\n
    \n
  • apikey (TEXT): The API key.
  • \n
\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_set_apikey('your_api_key');
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_set_apikey(apikey)","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-set-apikey"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_has_unsent_changes","filePath":"sqlite-sync-api-cloudsync-network-has-unsent-changes","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-has-unsent-changes","data":{"title":"cloudsync_network_has_unsent_changes()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Checks if there are any local changes that have not yet been sent to the remote server.\n\n**Parameters:** None.\n\n**Returns:** 1 if there are unsent changes, 0 otherwise.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_has_unsent_changes();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_has_unsent_changes.md","digest":"aa15b40ccc5c736f","rendered":{"html":"

Description: Checks if there are any local changes that have not yet been sent to the remote server.

\n

Parameters: None.

\n

Returns: 1 if there are unsent changes, 0 otherwise.

\n

Example:

\n
SELECT cloudsync_network_has_unsent_changes();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_has_unsent_changes()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-has-unsent-changes"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_send_changes","filePath":"sqlite-sync-api-cloudsync-network-send-changes","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-send-changes","data":{"title":"cloudsync_network_send_changes()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Sends all unsent local changes to the remote server.\n\n**Parameters:** None.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_send_changes();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_send_changes.md","digest":"8314badaa689b09b","rendered":{"html":"

Description: Sends all unsent local changes to the remote server.

\n

Parameters: None.

\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_send_changes();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_send_changes()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-send-changes"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_check_changes","filePath":"sqlite-sync-api-cloudsync-network-check-changes","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-check-changes","data":{"title":"cloudsync_network_check_changes()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Checks the remote server for new changes and applies them to the local database.\n\nIf a package of new changes is already available for the local site, the server returns it immediately, and the changes are applied. If no package is ready, the server returns an empty response and starts an asynchronous process to prepare a new package. This new package can be retrieved with a subsequent call to this function.\n\nThis function is designed to be called periodically to keep the local database in sync.\nTo force an update and wait for changes (with a timeout), use `cloudsync_network_sync(wait_ms, max_retries)`.\n\nIf the network is misconfigured or the remote server is unreachable, the function returns an error.\nOn success, it returns `SQLITE_OK`, and the return value indicates how many changes were downloaded and applied.\n\n**Parameters:** None.\n\n**Returns:** The number of changes downloaded. Errors are reported via the SQLite return code.\n\n**Errors:** See [Network Errors](#network-errors) for common error conditions.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_check_changes();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_check_changes.md","digest":"cc66a1abff704caf","rendered":{"html":"

Description: Checks the remote server for new changes and applies them to the local database.

\n

If a package of new changes is already available for the local site, the server returns it immediately, and the changes are applied. If no package is ready, the server returns an empty response and starts an asynchronous process to prepare a new package. This new package can be retrieved with a subsequent call to this function.

\n

This function is designed to be called periodically to keep the local database in sync.\nTo force an update and wait for changes (with a timeout), use cloudsync_network_sync(wait_ms, max_retries).

\n

If the network is misconfigured or the remote server is unreachable, the function returns an error.\nOn success, it returns SQLITE_OK, and the return value indicates how many changes were downloaded and applied.

\n

Parameters: None.

\n

Returns: The number of changes downloaded. Errors are reported via the SQLite return code.

\n

Errors: See Network Errors for common error conditions.

\n

Example:

\n
SELECT cloudsync_network_check_changes();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_check_changes()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-check-changes"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_sync","filePath":"sqlite-sync-api-cloudsync-network-sync","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-sync","data":{"title":"cloudsync_network_sync([wait_ms], [max_retries])","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Performs a full synchronization cycle. This function has two overloads:\n\n- `cloudsync_network_sync()`: Performs one send operation and one check operation.\n- `cloudsync_network_sync(wait_ms, max_retries)`: Performs one send operation and then repeatedly tries to download remote changes until at least one change is downloaded or `max_retries` times has been reached, waiting `wait_ms` between retries.\n\n**Parameters:**\n\n- `wait_ms` (INTEGER, optional): The time to wait in milliseconds between retries. Defaults to 100.\n- `max_retries` (INTEGER, optional): The maximum number of times to retry the synchronization. Defaults to 1.\n\n**Returns:** The number of changes downloaded. Errors are reported via the SQLite return code.\n\n**Example:**\n\n```sql\n-- Perform a single synchronization cycle\nSELECT cloudsync_network_sync();\n\n-- Perform a synchronization cycle with custom retry settings\nSELECT cloudsync_network_sync(500, 3);\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_sync.md","digest":"2093ecd56fd17e76","rendered":{"html":"

Description: Performs a full synchronization cycle. This function has two overloads:

\n
    \n
  • cloudsync_network_sync(): Performs one send operation and one check operation.
  • \n
  • cloudsync_network_sync(wait_ms, max_retries): Performs one send operation and then repeatedly tries to download remote changes until at least one change is downloaded or max_retries times has been reached, waiting wait_ms between retries.
  • \n
\n

Parameters:

\n
    \n
  • wait_ms (INTEGER, optional): The time to wait in milliseconds between retries. Defaults to 100.
  • \n
  • max_retries (INTEGER, optional): The maximum number of times to retry the synchronization. Defaults to 1.
  • \n
\n

Returns: The number of changes downloaded. Errors are reported via the SQLite return code.

\n

Example:

\n
-- Perform a single synchronization cycle\nSELECT cloudsync_network_sync();\n\n-- Perform a synchronization cycle with custom retry settings\nSELECT cloudsync_network_sync(500, 3);
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_sync([wait_ms], [max_retries])","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-sync"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_reset_sync_version","filePath":"sqlite-sync-api-cloudsync-network-reset-sync-version","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-reset-sync-version","data":{"title":"cloudsync_network_reset_sync_version()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Resets local synchronization version numbers, forcing the next sync to fetch all changes from the server.\n\n**Parameters:** None.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_reset_sync_version();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_reset_sync_version.md","digest":"7942caabd7906e07","rendered":{"html":"

Description: Resets local synchronization version numbers, forcing the next sync to fetch all changes from the server.

\n

Parameters: None.

\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_reset_sync_version();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_reset_sync_version()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-reset-sync-version"},"imagePaths":[]}},"collection":"docs"}},{"title":"cloudsync_network_logout","filePath":"sqlite-sync-api-cloudsync-network-logout","type":"inner","level":2,"entry":{"id":"sqlite-sync-api-cloudsync-network-logout","data":{"title":"cloudsync_network_logout()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","customClass":"","category":"platform","status":"publish"},"body":"**Description:** Logs out the current user and cleans up all local data from synchronized tables. This function deletes and then re-initializes synchronized tables, useful for switching users or resetting the local database. **Warning:** This function deletes all data from synchronized tables. Use with caution.\n\n**Parameters:** None.\n\n**Returns:** None.\n\n**Example:**\n\n```sql\nSELECT cloudsync_network_logout();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-sync/api-reference/cloudsync_network_logout.md","digest":"649235f66269b28e","rendered":{"html":"

Description: Logs out the current user and cleans up all local data from synchronized tables. This function deletes and then re-initializes synchronized tables, useful for switching users or resetting the local database. Warning: This function deletes all data from synchronized tables. Use with caution.

\n

Parameters: None.

\n

Returns: None.

\n

Example:

\n
SELECT cloudsync_network_logout();
","metadata":{"headings":[],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"cloudsync_network_logout()","description":"SQLite Sync is a multi-platform extension that brings a true local-first experience to your applications with minimal effort.","category":"platform","status":"publish","slug":"sqlite-sync-api-cloudsync-network-logout"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLite-Vector","filePath":"sqlite-vector","type":"inner","level":0,"entry":{"id":"sqlite-vector","data":{"title":"SQLite-Vector","description":"SQLite Cloud is a distributed relational database system built on top of the SQLite database engine.","customClass":"","category":"platform","status":"publish"},"body":"SQLite-Vector is a cross-platform, ultra-efficient SQLite extension that brings vector search capabilities directly into your embedded database\n\nWhether you're dealing with **millions of high-dimensional vectors** or operating on resource-constrained edge devices, SQLite-Vector delivers **lightning-fast performance** with a **tiny memory footprint**.\n\n**SQLite-Vector** is an open-source project available on GitHub.","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/sqlite-vector.mdx","digest":"c319c5c2782904ea","deferredRender":true,"collection":"docs"}},{"title":"MCP (Model Context Protocol)","filePath":"mcp-server","type":"inner","level":0,"entry":{"id":"mcp-server","data":{"title":"AI - Model Context Protocol (MCP)","description":"MCP Server for SQLite Cloud to interact with SQLite Cloud databases using the AI models","customClass":"","category":"platform","status":"publish"},"body":"The Model Context Protocol (MCP) is a standard for connecting various data sources (like your SQLite Cloud database) to Large Language Models (LLMs). The MCP Server for SQLite Cloud provides tools for executing queries, managing schemas, and analyzing query performance.\n\n## Features\n\n- **Query Execution**: Perform `SELECT`, `INSERT`, `UPDATE`, and `DELETE` SQL operations on SQLite Cloud databases.\n- **Schema Management**: Create tables, list existing ones, and retrieve schema details.\n- **Command Execution**: Run predefined commands supported by SQLite Cloud.\n- **Performance Analysis**: Identify slow queries, analyze query plans, and reset query statistics.\n\nExplore the available tools here.\n\n## Getting Started\n\nTo use the MCP Server, create a free account on SQLite Cloud and obtain your **Connection String**.\n\n### Requirements\n\nYou need Node.js installed on your computer to run the MCP Server. To check if Node.js is installed, open a terminal:\n\n- **Linux**: Open the terminal from the Applications menu.\n- **macOS**: Open the Terminal app from the Applications folder or use Spotlight Search (`Cmd+Space`) and type \"Terminal.\"\n- **Windows**: Press `Win + R`, type `cmd`, and press Enter to open the Command Prompt. Alternatively, search for \"Command Prompt\" in the Start menu.\n\nThen type the following command and press Enter:\n\n```bash\nnode --version\n```\n\nIf the command returns a version number, Node.js is installed. If you see an error like \"command not found\" or \"node is not recognized,\" download and install Node.js from nodejs.org.\n\n## Configure the AI Agent\n\nThis guide explains how to connect the MCP Server for SQLite Cloud to common AI agents that support MCP. \nFind a list of supported tools and IDEs here.\n\nAfter configuring your AI agent, try asking it questions about your SQLite Cloud database, such as:\n\n> What’s in my database on SQLite Cloud?\" \n\"What are the three most popular tracks by revenue in my SQLite Cloud database?\n\nExplore or manipulate your database using natural language queries.\n\n### Claude Desktop\n\nRefer to the official documentation for detailed instructions.\n\n1. Open Claude Desktop and navigate to **Settings**.\n2. Go to the **Developer** section and click on **Edit Config** to open the configuration file.\n3. Add the following configuration:\n\n ```json\n {\n \"mcpServers\": {\n \"sqlitecloud-mcp-server\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"@sqlitecloud/mcp-server\",\n \"--connectionString\",\n \"\"\n ]\n }\n }\n }\n ```\n\n Replace `` with your Connection String.\n\n4. Save the configuration file and restart Claude Desktop.\n5. You should see a _Hammer_ icon in the bottom-right corner of the input box. Click the icon to view the list of discovered tools.\n\n### Cursor\n\nRefer to the official documentation for detailed instructions.\n\n1. In the root of your project, create the file `.cursor/mcp.json`.\n2. Add the following configuration:\n\n ```json\n {\n \"mcpServers\": {\n \"sqlitecloud-mcp-server\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"@sqlitecloud/mcp-server\",\n \"--connectionString\",\n \"\"\n ]\n }\n }\n }\n ```\n\n Replace `` with your Connection String.\n\n3. Save the `mcp.json` file.\n4. Open the **Settings** page and navigate to the **MCP** section. You should see the MCP server with a green status indicator.\n5. In the Chat panel, select the \"Agent\" mode to interact with the AI model using the MCP Server.\n\n### VSCode Copilot\n\nRefer to the official documentation for detailed instructions.\n\n1. In the root of your project, create the file `.vscode/mcp.json`.\n2. Add the following configuration:\n\n ```json\n {\n \"mcp\": {\n \"inputs\": [\n {\n \"type\": \"promptString\",\n \"id\": \"sqlitecloud-connection-string\",\n \"description\": \"Set the SQLite Cloud Connection String\",\n \"password\": true\n }\n ],\n \"servers\": {\n \"sqlitecloud-mcp-server\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"@sqlitecloud/mcp-server\",\n \"--connectionString\",\n \"${input:sqlitecloud-connection-string}\"\n ]\n }\n }\n }\n }\n ```\n\n3. Save the `mcp.json` file.\n4. Open Copilot Chat and select the **Agent** mode from the menu near the **Send** button. A tool icon will appear, showing the discovered tools. Before starting the server, VSCode will prompt you to enter your Connection String.","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/mcp-server.mdx","digest":"215fa6a7f61ecbd6","deferredRender":true,"collection":"docs"}},{"title":"AI-Powered Docs Search","filePath":"aisearch-documents","type":"inner","level":0,"entry":{"id":"aisearch-documents","data":{"title":"Build AI Search for Your Documentation","description":"SQLite AI Search for your documents and files","customClass":"","category":"platform","status":"publish"},"body":"import Callout from \"@commons-components/Information/Callout.astro\";\n\nThis guide shows you how to set up a ready-to-use AI semantic search for your documents and files.\nUsing the [sqlite-aisearch-action](https://github.com/sqliteai/sqlite-aisearch-action), you can integrate document processing into your GitHub workflow and set up a chatbot on your site in just a few steps.\n\nThe semantic search is powered by [SQLite RAG](https://github.com/sqliteai/sqlite-rag).\n\n## Step 1: Set Up Your GitHub Workflow\n\n1. **Get Your Connection String**: Ensure you have a project on the [SQLite Cloud dashboard](https://dashboard.sqlitecloud.io). If not, sign up for [SQLite AI](https://sqlite.ai) to create one for free.\n\n2. **Set GitHub Secret**: Add your connection string as `SQLITECLOUD_CONNECTION_STRING` in your repository secrets.\n\n3. **Add to Workflow**: Create or update your GitHub workflow:\n\n```yaml\nname: AI Search Index\n\non:\n push:\n branches: [main]\n workflow_dispatch:\n\njobs:\n build-search:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n\n - name: Build AI Search Database\n uses: sqliteai/sqlite-aisearch-action@v1\n with:\n connection_string: ${{ secrets.SQLITECLOUD_CONNECTION_STRING }}\n base_url: https://docs.yoursite.com\n database_name: aidocs_search.db\n source_files: ./path/to/documents\n```\n\n## Step 2: Create the Search Edge Function\n\nTo enable search functionality on your indexed database, create an Edge Function using the provided template:\n\n1. Access your dashboard at https://dashboard.sqlitecloud.io\n2. Navigate to the same project where your database was uploaded\n3. Go to the **Edge Functions** section\n ![AISearch Edge Function](@docs-website-assets/aisearch-docs/edgefn_aisearch.png)\n4. Create a new `Javascript Function` and copy the code from [aisearch-docs.js](https://github.com/sqliteai/sqlite-aisearch-action/blob/main/search_edge_function_template/aisearch-docs.js) into the editor\n5. Deploy and test\n\n### How to Perform a Search\n\n1. Go to **Details** in the Edge Function panel and copy the **Function URL**\n ![AISearch Edge Function Details](@docs-website-assets/aisearch-docs/edgefn_aisearch_details.png)\n2. Execute a GET request with a URL-encoded query as the `query` parameter\n\n Example:\n\n ```\n GET https://myproject.cloud/v2/functions/aisearch-docs?query=what%27s+Offsync%3F\n ```\n\n## Step 3: Integrate the Docs Chatbot in Your Website\n\nOnce you have your search edge function deployed, you can easily add an interactive AI chatbot to your website. The chatbot provides a user-friendly interface for your documentation search, powered by the indexed content.\n\n![Docs Chatbot](@docs-website-assets/aisearch-docs/docs_chatbot.png)\n\n### React Integration\n\nInstall the chatbot package:\n\n```bash\nnpm install @sqliteai/docs-chatbot\n```\n\nThen add it to your React application:\n\n```tsx\nimport { DocsChatbot } from \"@sqliteai/docs-chatbot\";\nimport \"@sqliteai/docs-chatbot/style.css\";\n\nfunction App() {\n return (\n \n );\n}\n```\n\n\n - Replace the `searchUrl` with your **Function URL** from Step 2 \n - For the `apiKey`, you need to use an API key with read\n permissions on your AI docs database. Learn how to create and manage API keys\n in the [API Key documentation](/docs/apikey).\n\n\n### Vanilla JavaScript\n\nFor non-React applications, use the web component:\n\n```html\n\n\n \n \n \n \n \n \n\n \n \n \n\n```\n\nBy default, the chatbot displays as a floating button in the bottom-right corner.\nFor advanced configuration options including custom triggers, theming, and API reference, see the [full docs chatbot documentation](https://github.com/sqliteai/docs-chatbot).","filePath":"docs-website/content/docs/sqlite-cloud/sqlite-ai/aisearch-documents.mdx","digest":"757e2c11c87822da","deferredRender":true,"collection":"docs"}},{"title":"Overview","filePath":"overview","type":"inner","level":0,"entry":{"id":"overview","data":{"title":"Getting Started with SQLite Cloud","description":"SQLite Cloud is a distributed relational database system built on top of the SQLite database engine.","customClass":"","category":"getting-started","status":"publish"},"body":"## Overview\n**SQLite Cloud** is a managed, distributed relational database system built on top of the SQLite database engine. \n\nIt has been designed from the ground up to ensure strong consistency across all nodes in a cluster while simultaneously managing the technical aspects of scaling, security, and data distribution. This ensures that you can focus on your core tasks while relying on SQLite Cloud to handle the complexities of managing your databases.\n\nSQLite Cloud is built on the open source SQLite engine, ensuring complete feature parity. You get all of SQLite's core strengths: ACID compliance, support for complex SQL operations, and compatibility with the rich SQLite extension ecosystem.\n\nYou can access SQLite Cloud from the most popular programming languages or its REST API. \n\nLike SQLite, each database in SQLite Cloud is a separate file, giving you flexible deployment options:\n\n* Create separate databases for each customer in a multi-tenant application\n* Share a single database among multiple users with built-in access controls\n* Mix both approaches based on your application's needs\n\n### Features\nSQLite Cloud provides a comprehensive suite of tools for building realtime, local-first, edge AI applications.\n* **[Webhooks](/docs/webhooks)**: Trigger edge functions or send change payloads via HTTP, Websockets, or on database events like INSERT, UPDATE, and DELETE.\n* **[Edge Functions](/docs/edge-functions)**: Run serverless functions on the same nodes that store your data for lightning-fast data access.\n* **[Pub/Sub](/docs/pub-sub)**: Subscribe to changes in your database to replicate data, power notifications, and build multiplayer experiences.\n* **[Weblite](/docs/weblite)**: Autogenerated REST APIs to interact with the SQLite Cloud platform.\n* **[Query Analyzer](/docs/analyzer)**: Receive optimization recommendations for your queries to improve performance.","filePath":"docs-website/content/docs/sqlite-cloud/overview.mdx","digest":"880102e53c9156d7","deferredRender":true,"collection":"docs"}},{"title":"Scaling","filePath":"architecture","type":"inner","level":0,"entry":{"id":"architecture","data":{"title":"Architecture","description":"SQLite Cloud Architecture","customClass":"","category":"getting-started","status":"publish"},"body":"## Architecture\nSQLite Cloud uses the Raft consensus algorithm to distribute your data changes across a cluster of computing systems, ensuring that each node in the cluster agrees upon the same series of state transitions. Raft implements consensus with a leader approach.\n\nSQLite Cloud is written in ANSI C and GO, and it works on most POSIX systems (Linux, *BSD, Mac OS X) and Windows. \n\nSQLite Cloud supports all the SQLite features without any limitations, including ACID compliance and non-deterministic SQL statements.\n\n## Scaling your cluster\nSQLite Cloud leverages a customized Raft algorithm to maintain a robust and highly available database cluster. Here’s an essential guide on the node types within SQLite Cloud and strategic tips for scaling your cluster effectively.\n\n## Overview of Node types\n\n### Leader Nodes\nThe central command of your SQLite Cloud cluster is the Leader node, responsible for handling all write operations and coordinating updates across the cluster. This node replicates the changes to Follower and Learner nodes. Due to the unique role of the Leader node, increasing the number of Leader nodes is not a feasible method for scaling write operations.\n\n### Follower Nodes\nThese nodes handle read requests and are necessary to maintain your cluster’s fault tolerance. Followers also participate in leader elections if the leader node becomes unavailable. It is recommended to maintain an odd number of Follower nodes to prevent split votes during elections, ensuring a majority is always possible, thus enhancing the cluster's stability and fault tolerance.\n\n### Learner Nodes\nLearners are special types of Follower nodes that do not participate in elections but help scale the cluster's read capacity without affecting write latency. Adding Learner nodes is a strategic way to boost read throughput, especially in geographically distributed environments.\n\n\n## Scaling Read Capacity\nTo enhance read performance, simply add Learner nodes. These nodes increase the cluster’s ability to handle read requests without contributing to the consensus process, thus not impacting write latencies. \n\nTo enhance fault-tolerance, add follower nodes, but ensure that the number of follower nodes is odd to prevent split votes during leader elections.","filePath":"docs-website/content/docs/sqlite-cloud/architecture.mdx","digest":"41aaf015d8dec17c","deferredRender":true,"collection":"docs"}},{"title":"Connecting","filePath":"connect-cluster","type":"inner","level":1,"entry":{"id":"connect-cluster","data":{"title":"Connecting to a Cluster","description":"Learn how to connect to a cluster in SQLite Cloud.","customClass":"","category":"getting-started","status":"publish"},"body":"SQLite databases in SQLite Cloud are distributed across a cluster of nodes. Each cluster comes with a multi-region load balancer that routes traffic to the nearest appropriate node.\n\nClick \"Connect\" in the bottom left-hand corner of your dashboard to get your connection string to use with a SQLite Cloud client library.\n\n\n---\n\n\n## Connecting with JavaScript\nHere's an example of how you can connect to your cluster using the `@sqlitecloud/drivers` JavaScript client library:\n\nFirst, install the client library:\n\n```bash\nnpm install @sqlitecloud/drivers\n```\n\nThen, connect to your cluster using the connection string:\n\n```javascript\nimport { Database } from '@sqlitecloud/drivers';\n\nconst db = new Database('sqlitecloud://.sqlite.cloud:?apikey=')\n\nconst fetchAlbums = async () => await db.sql`USE DATABASE chinook.sqlite; SELECT * FROM albums;`;\n\nfetchAlbums().then((albums) => console.log(albums));\n\n// [{ Title: 'For Those About To Rock We Salute You', ... }, ...]\n```\n\n---\n\n## Connecting with Python\nInstall the Python client library:\n\n```bash\npip install sqlitecloud\n```\n\nThen, connect to your cluster using the connection string:\n\n```python\nimport sqlitecloud\n\n# Open the connection to SQLite Cloud\n# Note: Include your target database in the url to skip the USE DATABASE command\nconn = sqlitecloud.connect(\"sqlitecloud://.sqlite.cloud:?apikey=\")\n\ncursor = conn.execute(\"SELECT * FROM albums WHERE AlbumId = ?\", (1, ))\nresult = cursor.fetchone()\n\nprint(result)\n\nconn.close()\n\n# (1, 'For Those About To Rock We Salute You', 1)\n```\n\n---\n\n## Next Steps\n- [Creating a database](/docs/create-database)\n- [Writing data](/docs/write-data)","filePath":"docs-website/content/docs/sqlite-cloud/connect-cluster.mdx","digest":"49bd5379d087d511","deferredRender":true,"collection":"docs"}},{"title":"Creating a database","filePath":"create-database","type":"inner","level":1,"entry":{"id":"create-database","data":{"title":"Creating a Database","description":"Learn how to import a database into SQLite Cloud.","customClass":"","category":"getting-started","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport uploadDb from '@docs-website-assets/introduction/video/dashboard_upload_db.mp4';\nimport createDb from '@docs-website-assets/introduction/video/dashboard_create_db.mp4';\n\nYou can import an existing SQLite databases, or create new databases using the SQLite Cloud UI, API, or client libraries.\n\n---\n\n## Uploading an existing SQLite Database\n### Via HTTP API\nYou can upload an existing SQLite database to your cluster using the SQLite Cloud UI or the Weblite API.\n\nTo upload a local SQLite database via weblite, make a POST request to the `/v2/weblite/.sqlite` endpoint.\n\n```bash\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite/.sqlite' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey=' \\\n -d ''\n```\n\nTo upload a local SQLite database via the SQLite Cloud UI, navigate to the Database tab in the left-hand navigation. Click the \"Upload Database\" button and select your local SQLite database.\n\n### Via Dashboard UI\nTo import a database from the UI, navigate to the Databases tab and click the \"Upload Database\" button.\n\nSelect the database file you want to upload, and click \"Upload Database\". The database will be available in your cluster within a few minutes.\n\n\n\n---\n\n## Creating a new database\n### From the Dashboard\n\nTo create a new database from the SQLite Cloud UI, navigate to the Databases tab and click the \"Create Database\" button.\n\nThe default encoding is set to UTF-8, and the default page size is 4096KB.\n\n\n\n### From the API\nTo create a new database or upload an existing database via [Weblite](/docs/weblite), our REST API, you can make a request with the following parameters:\n```bash\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite/.sqlite' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey=' \\\n -d ''\n```\n\n### From client libraries\nTo create a new database from a client library, connect to your cluster using a connection string without a specified database.\n\nThen, use the CREATE DATABASE command to create a new database. \n\nTo start using the database within the connection, you can use the `USE DATABASE` command.\n\n```javascript\nimport { Database } from '@sqlitecloud/drivers';\n// note that no database name is specified in the connection string path\nconst db = new Database('sqlitecloud://.sqlite.cloud:?apikey=')\n\nconst createDatabase = async () => await db.sql`CREATE DATABASE ;`;\n\ncreateDatabase().then((res) => console.log(res));\n\n// \"OK\"\n\ndb.exec('USE DATABASE ;')\n\n// now you can use the database\nconst fetchAlbums = async () => await db.exec`SELECT * FROM albums;`;\n\nfetchAlbums().then((albums) => console.log(albums));\n\n// [{ Title: 'For Those About To Rock We Salute You', ... }, ...]\n```\n\n## Next Steps\n- [Writing data](/docs/write-data)","filePath":"docs-website/content/docs/sqlite-cloud/create-database.mdx","digest":"de2aa0e705723bd6","deferredRender":true,"collection":"docs"}},{"title":"Writing data","filePath":"write-data","type":"inner","level":1,"entry":{"id":"write-data","data":{"title":"Writing data to your database","description":"Learn how to write data to your SQLite Cloud cluster.","customClass":"","category":"getting-started","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport studioInsert from '@docs-website-assets/introduction/video/dashboard_studio.mp4';\n\nAfter you've created a database in SQLite Cloud, you can start writing data to it. You can write data to your cluster using the SQLite Cloud UI, API, or client libraries.\n\n---\n\n## Writing data with the SQLite Cloud UI\nNavigate to the Studio tab from the left-hand navigation. From here, you can run SQL commands directly on your cluster.\nIf needed, use the dropdown menus to select the database and table where you want to insert or update data.\n\nAlternatively, you can also interact directly with the table view to add new records or update existing ones without writing SQL manually.\n\n\n\n\n### Example\n```sql\n-- If you haven't selected a database yet, run the USE DATABASE command\nUSE DATABASE .sqlite; \n-- Create your table\nCREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_make TEXT NOT NULL, sc_year INTEGER NOT NULL);\n-- Insert data into your table\nINSERT INTO sports_cars (sc_make, sc_year) VALUES ('Ferrari', 2021);\n```\n\n---\n\n## Writing data with the Weblite API\nYou can use the [Weblite API](/docs/weblite) to run SQL commands against your cluster. Here is an example cURL request:\n\n```bash\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite/sql' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey=' \\\n -d ''\n```\n\n---\n\n## Writing data with client libraries\nTo write data to your cluster using a client library, use the INSERT INTO SQL command. \n\n```javascript\nimport { Database } from '@sqlitecloud/drivers';\n\nconst db = new Database('sqlitecloud://.sqlite.cloud:?apikey=')\ndb.exec('USE DATABASE .sqlite;')\ndb.exec('CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_make TEXT NOT NULL, sc_year INTEGER NOT NULL);')\ndb.commit()\nconst insertData = async () => await db.sql('INSERT INTO sports_cars (sc_make, sc_year) VALUES (?, ?)', 'Ferrari', 2021);\n\ninsertData().then((res) => console.log(res));\n// \"OK\"\n```","filePath":"docs-website/content/docs/sqlite-cloud/write-data.mdx","digest":"83655c5f7574b2a0","deferredRender":true,"collection":"docs"}},{"title":"CDN","filePath":"quick-start-cdn","type":"inner","level":1,"entry":{"id":"quick-start-cdn","data":{"title":"CDN Quick Start Guide","description":"Get started with SQLite Cloud using a Content Delivery Network","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we demonstrate how to locally serve the SQLite Cloud JS Drivers from a CDN.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a JavaScript / TypeScript app**\n - The following commands bootstrap a TypeScript app.\n```bash\nmkdir sqlc-quickstart\ncd sqlc-quickstart\n\nnpm init -y\nnpm install typescript ts-node @types/node --save-dev\nnpx tsc --init\n```\n\n3. **Install the SQLite Cloud JS SDK**\n```bash\nnpm install @sqlitecloud/drivers\n```\n\n4. **Load our example in your browser**\n\nCopy the following to your ```index.html``` file:\n```html\n\n\n \n \n SQLite Cloud CDN Quickstart\n \n \n \n\n \n

\n SQLite Cloud Example: Checking Chinook Customers\n

\n\n
\n
\n \n Send!\n \n\n

Results:

\n
    \n\n \n \n\n```\n\n - This HTML form sends a query to the `chinook.sqlite` database. You can load the form by simply dragging and dropping the file into your browser.\n - To use SQLite Cloud's JS drivers, the example includes an additional script in the `` tag: ``. Update `{version}` with the most recent repo release.\n\n5. **Query data**\n - There are 2 ways to query data.\n 1. In your SQLite Cloud account dashboard, click on a Node, copy the Connection String, and paste it into the form's `Database Connection String` input. The expected string format is: `sqlitecloud://{host}.sqlite.cloud:8860?apikey={apikey}`.\n \n - Since this Connection String format does NOT contain the database to query, you MUST include the database name in your query. The expected query format is: `USE DATABASE {database}; select * from {table}`.\n - IMPORTANT: The example SQL we provide (`USE DATABASE chinook.sqlite; select * from customers limit 3`) queries the `customers` table in the `chinook` database. The results are specifically parsed to be more readable. To display raw data from any table, uncomment the `index.html` code starting after `// list raw data` and comment out the later `for` loop.\n\n 2. An alternative Connection String format is: `sqlitecloud://{username}:{password}@{host}.sqlite.cloud:8860/{database}`.\n\n - Since this Connection String format DOES contain the database to query, you can exclude the database name from your query: `select * from {table}`.\n - To get your admin username, go to your SQLite Cloud account dashboard. In the left nav, open Security and select Users. Your admin username has already been created. Replace `{username}` the connection string.\n - To set your admin user's password, click the row's down chevron and select Edit. Enter a new Password and click Save. Replace `{password}` in the connection string.\n - To get the host, see under your Project name `{host}.sqlite.cloud`.\n - To get the database name, in the left nav, open Databases and select Tables. All of your databases are listed in the Select Database dropdown.\n \n - Send your query! Returned results will be listed, from most to least recent, below the form inputs.\n\nAnd that's it! You've successfully submitted a simple form to read data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-cdn.mdx","digest":"bea6bd01a442723e","deferredRender":true,"collection":"docs"}},{"title":"Node.js","filePath":"quick-start-node","type":"inner","level":1,"entry":{"id":"quick-start-node","data":{"title":"Node.js Quick Start Guide","description":"Get started with SQLite Cloud using Node.js and Express.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and Node.js by building a simple web server that connects to and reads from a SQLite Cloud database, then serves that data to the client.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n2. **Create a Node.js app**\n - Navigate to your target directory and run the following command to initialize your Node.js app and install the necessary depedencies:\n```bash\nnpm init\n``` \n - After creating your project, install the SQLite Cloud SDK:\n```bash\nnpm install express @sqlitecloud/drivers --save\n```\n - Create a file named `index.js` in the root directory of your project.\n\n3. **Query data**\n - Grab a connection string by clicking on a node in your dashboard.\n - Paste the following into your `index.js` file:\n\n```javascript\nconst express = require(\"express\");\nconst { Database } = require(\"@sqlitecloud/drivers\");\n\nconst connectionString = process.env.SQLITECLOUD_CONNECTION_STRING\nconst app = express();\n\napp.get(\"/albums\", async (req, res) => {\n let db = null;\n try {\n db = new Database(connectionString)\n const result = await db.sql(`\n USE DATABASE chinook.sqlite; \n SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist\n FROM albums \n INNER JOIN artists \n WHERE artists.ArtistId = albums.ArtistId\n LIMIT 20;`);\n res.json(result);\n } catch (error) {\n res.status(500).json({ error: error.message });\n } finally {\n db?.close();\n }\n});\n\napp.listen(3000, () => {\n console.log(\"Server running on port 3000\");\n});\n```\n5. **Run your app**\n```bash\nnode index.js\n```\n6. **View your web server response**\n - Open your browser and navigate to `http://localhost:3000/albums` to see your app in action.\n\nAnd that's it! You've successfully built a Node.js app that reads and serves data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-node.mdx","digest":"26adb86328e783ec","deferredRender":true,"collection":"docs"}},{"title":"React","filePath":"quick-start-react","type":"inner","level":1,"entry":{"id":"quick-start-react","data":{"title":"React Quick Start Guide","description":"Get started with SQLite Cloud using React.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and React by building a simple application that connects to and reads from a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n2. **Create a React app**\n - Create a React app using a Vite template\n```bash\nnpm create vite@latest sqlc-quickstart -- --template react\n```\n3. **Install the SQLite Cloud SDK**\n```bash\ncd sqlc-quickstart && npm install @sqlitecloud/drivers\n```\n4. **Query data**\n - Grab a connection string by clicking on a node in your dashboard.\n - Use the following code to display data from your database.\n ```jsx\nimport { useEffect, useState } from \"react\";\nimport { Database } from '@sqlitecloud/drivers';\n\nfunction App() {\n const [data, setData] = useState([]);\n\n const getAlbums = async () => {\n let db = null;\n try {\n db = new Database('')\n const result = await db.sql(`\n USE DATABASE chinook.sqlite; \n SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist\n FROM albums \n INNER JOIN artists \n WHERE artists.ArtistId = albums.ArtistId\n LIMIT 20;`);\n setData(result);\n } catch (err) {\n // manage error state\n console.error(`getAlbums - ${error}`, error);\n } finally {\n db?.close();\n }\n };\n\n useEffect(() => {\n getAlbums();\n }, []);\n\n return (\n
    \n

    Albums

    \n
      \n {data.map((album) => (\n
    • {album.title} by {album.artist}
    • \n ))}\n
    \n
    \n );\n}\n\nexport default App\n```\n5. **Run your app**\n```bash\nnpm run dev\n```\n6. **View your app**\n - Open your browser and navigate to the localhost link provided by the previous command to see your app data.\n\nAnd that's it! You've successfully built a React app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-react.mdx","digest":"d20281fa6c0b7971","deferredRender":true,"collection":"docs"}},{"title":"React Native","filePath":"quick-start-react-native","type":"inner","level":1,"entry":{"id":"quick-start-react-native","data":{"title":"React Native Quick Start Guide","description":"Get started with SQLite Cloud using React Native.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and React Native by building a simple application that connects to and reads from a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a React Native project**\n - If you haven't already, sign up for an Expo account.\n - Create a new remote EAS project with the name `sqlc-quickstart`.\n - Link your remote project to a new local project. Replace `{id}` below with the project ID provided by Expo.\n\n```bash\nnpm install --global eas-cli\nnpx create-expo-app sqlc-quickstart\ncd sqlc-quickstart\neas init --id {id}\n```\n\n3. **Install the SQLite Cloud JS SDK and peer dependencies**\n\n```bash\nnpm install @sqlitecloud/drivers react-native-tcp-socket react-native-fast-base64\n```\n\n4. **Query data**\n - Replace the code in `app/(tabs)/index.tsx` with the following snippet.\n - In your SQLite Cloud account dashboard, click on a Node, copy the Connection String, and replace `` below.\n\n```jsx\nimport { Database } from '@sqlitecloud/drivers';\nimport { useState, useEffect } from 'react';\nimport { View, Text, FlatList, StyleSheet } from 'react-native';\n\nexport default function App() {\n const [albums, setAlbums] = useState([]);\n\n useEffect(() => {\n async function getAlbums() {\n let db = null;\n try {\n db = new Database('');\n\n const result =\n await db.sql(`USE DATABASE chinook.sqlite; \n SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist \n FROM albums \n INNER JOIN artists \n WHERE artists.ArtistId = albums.ArtistId LIMIT 20;`);\n\n setAlbums(result);\n } catch (error) {\n // manage error state\n console.error(`getAlbums - ${error}`, error)\n } finally {\n db?.close();\n }\n }\n\n getAlbums();\n }, []);\n\n return (\n \n Albums\n item.id}\n renderItem={({ item }) => (\n \n • {item.title} by {item.artist}\n \n )}\n />\n \n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n padding: 15,\n },\n title: {\n fontSize: 34,\n fontWeight: 600,\n },\n listItem: {\n paddingVertical: 3,\n },\n});\n```\n - On `App` component mount, `useEffect` defines and calls a function that connects to and queries your database, updates the component's state with the most up-to-date `albums` data, and renders the data in a list.\n\n5. **Run your app**\n\nExpo run iOS\n```bash\nnpx expo prebuild && npx expo run:ios\n```\n\nExpo run Android\n```bash\nnpx expo prebuild && npx expo run:android\n```\n\nAnd that's it! You've successfully built a React Native app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-react-native.mdx","digest":"35baa27bc3a826d6","deferredRender":true,"collection":"docs"}},{"title":"Apollo / GraphQL","filePath":"quick-start-apollo-graphql","type":"inner","level":1,"entry":{"id":"quick-start-apollo-graphql","data":{"title":"Apollo / GraphQL Quick Start Guide","description":"Get started with SQLite Cloud using Apollo and GraphQL.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and Apollo/GraphQL by writing a simple GraphQL wrapper around a SQLite Cloud database connection.\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Install the necessary dependencies**\n - In your terminal run the following commands to install a new Apollo Server app.\n \n```bash\nmkdir sqlc-quickstart\ncd sqlc-quickstart\nnpm install apollo-server graphql\n```\n\n3. **Create a new Apollo Server app**\n - Create a new file called `server.js` and add the following code.\n - Import the necessary packages, and instantiate a new Database connection.\n```js\nimport { ApolloServer } from '@apollo/server';\nimport { startStandaloneServer } from '@apollo/server/standalone';\nimport { Database } from '@sqlitecloud/drivers';\n\nconst connStr = ''\n\nconst db = new Database(connStr)\n```\n- Next, define your GraphQL schema and resolvers.\n```js\nconst typeDefs = `#graphql\n type Album {\n AlbumId: Int\n Title: String\n ArtistId: Int\n }\n\n type Artist {\n ArtistId: Int\n Name: String\n }\n\n type Track {\n TrackId: Int\n Name: String\n AlbumId: Int\n MediaTypeId: Int\n GenreId: Int\n Composer: String\n Milliseconds: Int\n Bytes: Int\n UnitPrice: Float\n }\n\n type Genre {\n GenreId: Int\n Name: String\n }\n\n type MediaType {\n MediaTypeId: Int\n Name: String\n }\n\n type Join {\n AlbumId: Int\n Title: String\n ArtistName: String\n }\n\n type Query {\n albums: [Album]\n artists: [Artist]\n tracks: [Track]\n genres: [Genre]\n mediaTypes: [MediaType]\n joins: [Join]\n artist(name: String): Artist\n albumsByArtist(artistId: Int): [Album]\n }\n\n type Mutation {\n createArtist(name: String): Artist\n createAlbum(title: String, artistId: Int): Album\n }\n`;\n\nconst resolvers = {\n Query: {\n albums: async () => {\n return await db.sql`SELECT * FROM albums`;\n },\n artists: async () => {\n return await db.sql`SELECT * FROM artists`;\n },\n tracks: async () => {\n return await db.sql`SELECT * FROM tracks`;\n },\n genres: async () => {\n return await db.sql`SELECT * FROM genres`;\n },\n mediaTypes: async () => {\n return await db.sql`SELECT * FROM media_types`;\n },\n artist: async (_, { name }) => {\n const res = await db.sql`SELECT * FROM artists WHERE Name LIKE ${name};`;\n if (res.length === 0) return null;\n return res[0];\n },\n albumsByArtist: async (_, { artistId }) => {\n return await db.sql`SELECT albums.AlbumId, albums.Title FROM albums INNER JOIN artists ON albums.ArtistId = artists.ArtistId WHERE artists.ArtistId = ${artistId}`;\n },\n },\n Mutation: {\n createArtist: async (_, { name }) => {\n const res =\n await db.sql`INSERT INTO artists (Name) VALUES (${name})`;\n if (res.changes === 0) return null;\n return { ArtistId: res.lastID, Name: name };\n },\n createAlbum: async (_, { title, artistId }) => {\n const res =\n await db.sql`INSERT INTO albums (Title, ArtistId) VALUES (${title}, ${artistId})`;\n if (res.changes === 0) return null;\n return {\n AlbumId: res.lastID,\n Title: title,\n ArtistId: artistId,\n };\n },\n },\n};\n```\n\n- Lastly, pass the GraphQL type definitions and resolvers into a new ApolloServer instance, and start the server.\n```js\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nconst { url } = await startStandaloneServer(server, {\n listen: { port: 4000 },\n context: async () => ({ db })\n});\n \nconsole.log(`🚀 Server ready at: ${url}`);\n```\n\n4. **Run your app**\n - In your terminal, run the following command to start your Apollo Server.\n```bash\nnode server.js\n```\n\n5. **Query your data**\n - Open your browser and navigate to `http://localhost:4000` to access the Apollo GraphQL Playground.\n - Use the following queries to interact with your SQLite Cloud database.\n\nRead operation:\n```graphql\nquery {\n albums {\n AlbumId\n Title\n ArtistId\n }\n}\n```\n\nWrite operation:\n```graphql\nmutation {\n createArtist(name: \"New Artist\") {\n ArtistId\n Name\n }\n}\n```\n\nAnd that's it! You've successfully built an Apollo/GraphQL server that reads and writes data to a SQLite Cloud database.\n\nFor the full code example, see the SQLite Cloud Apollo/GraphQL example repo.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-apollo-graphql.mdx","digest":"e8eae29023dc2713","deferredRender":true,"collection":"docs"}},{"title":"Next.js","filePath":"quick-start-next","type":"inner","level":1,"entry":{"id":"quick-start-next","data":{"title":"Next.js Quick Start Guide","description":"Get started with SQLite Cloud using Next.js.","customClass":"","category":"getting-started","status":"publish"},"body":"This quick start guide will walk you through setting up a Next.js application that connects to and queries a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - For this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a Next.js app**\n - Use ```create-next-app``` to set up a new Next.js project. The following command creates a minimal app with TypeScript and the latest App Router, keeping the focus on querying data.\n```bash\nnpx create-next-app@latest sqlc-quickstart --ts --no-tailwind --eslint --app --src-dir --import-alias \"@/*\" --use-npm\n```\n\n3. **Install the SQLite Cloud SDK**\n```bash\ncd sqlc-quickstart && npm install @sqlitecloud/drivers\n```\n\n4. **Configure the Database Connection**\n - Create a `.env.local` file in the root of your Next.js project and add your SQLite Cloud connection string:\n```bash\nSQLITECLOUD_URL=sqlitecloud://abcd1234.global1.qwerty.sqlite.cloud:8860/chinook.sqlite?apikey=your-api-key\nNEXT_PUBLIC_SQLITECLOUD_URL=sqlitecloud://abcd1234.global1.qwerty.sqlite.cloud:8860/chinook.sqlite?apikey=your-api-key\n```\n - The database driver establishes a TLS connection in Node.js and a WebSocket connection in the browser. \n\n\n5. **Set Up the Folder Structure**\n```bash\nmkdir -p src/app/api/albums\nmkdir -p src/app/components\nmkdir -p src/constants\n\ntouch src/app/api/albums/route.ts\ntouch src/app/components/GetAlbumsClient.tsx\ntouch src/app/components/GetAlbumsServer.tsx\ntouch src/app/components/UpdateAlbumsClient.tsx\ntouch src/constants/queries.ts\ntouch src/types.ts\n```\n\n6. **Define Data Types**\n```ts\n//\n// src/type.ts (Server Component)\n//\n\nexport interface Album {\n id: number;\n title: string;\n artist: string;\n}\n\n```\n\n7. **Define Queries**\n```ts\n//\n// src/constants/queries.ts\n//\n\nexport const GET_ALBUMS = `\n USE DATABASE chinook.sqlite; \n SELECT albums.AlbumId AS id, albums.Title AS title, artists.Name AS artist\n FROM albums\n INNER JOIN artists ON albums.ArtistId = artists.ArtistId\n LIMIT 20;\n`;\n\nexport const GET_LAST_TEN_ALBUMS = `\n USE DATABASE chinook.sqlite; \n SELECT albums.AlbumId AS id, albums.Title AS title, artists.Name AS artist\n FROM albums\n INNER JOIN artists ON albums.ArtistId = artists.ArtistId\n ORDER BY albums.AlbumId DESC\n LIMIT 10;\n`;\n\nexport const INSERT_ALBUM = `\n USE DATABASE chinook.sqlite; \n INSERT INTO albums (Title, ArtistId) VALUES (?, ?);\n`;\n```\n\n8. **Fetch Data via a Route Handler**\n\nYou can create a route handler for handling `GET` and `POST` requests.\n\n```ts\n//\n// src/app/api/albums/route.ts (Route Handler)\n//\n\nimport { NextResponse } from \"next/server\";\nimport { Database } from \"@sqlitecloud/drivers\";\nimport { GET_LAST_TEN_ALBUMS, INSERT_ALBUM } from \"@/constants/queries\";\n\nexport async function GET() {\n let db;\n\n try {\n db = new Database(process.env.SQLITECLOUD_URL!);\n const result = await db.sql(GET_LAST_TEN_ALBUMS);\n\n return NextResponse.json(result);\n } catch (error) {\n let message = \"An unknown error occurred\";\n\n if (error instanceof Error) {\n message = error.message;\n }\n\n return NextResponse.json({ error: message }, { status: 500 });\n } finally {\n db?.close();\n }\n}\n\nexport async function POST(req: Request) {\n const { title, artistId } = await req.json();\n let db;\n\n try {\n db = new Database(process.env.SQLITECLOUD_URL!);\n await db.sql(INSERT_ALBUM, ...[title, artistId]);\n\n return NextResponse.json({ success: true });\n } catch (error) {\n let message = \"An unknown error occurred\";\n\n if (error instanceof Error) {\n message = error.message;\n }\n\n return NextResponse.json({ error: message }, { status: 500 });\n } finally {\n db?.close();\n }\n}\n```\n\n9. **Fetch Data in a Server Component**\n\nTo fetch data directly from the server and render it in a Server Component:\n\n```tsx\n//\n// src/app/components/GetAlbumsServer.tsx (Server Component)\n//\n\nimport { GET_ALBUMS } from \"@/constants/queries\";\nimport { Album } from \"@/types\";\nimport { Database } from \"@sqlitecloud/drivers\";\nimport { unstable_noStore as noStore } from \"next/cache\";\n\nexport default async function GetAlbumsServer() {\n noStore(); // Prevents Next.js from caching the database request\n let db;\n\n try {\n db = new Database(process.env.SQLITECLOUD_URL!);\n const result = await db.sql(GET_ALBUMS);\n\n return (\n
    \n

    \n Albums (Server Component)\n

    \n
      \n {result.map((album: Album) => (\n
    • \n {album.title} -{\" \"}\n {album.artist}\n
    • \n ))}\n
    \n
    \n );\n } catch (error) {\n let message = \"An unknown error occurred\";\n\n if (error instanceof Error) {\n message = error.message;\n }\n return

    Error loading albums: {message}

    ;\n } finally {\n db?.close();\n }\n}\n```\n\n10. **Fetch Data in a Client Component** \nSince the SQLite Cloud driver can run in the browser, you can use it directly in a Client Component without needing an API route.\n\n```tsx\n//\n// src/app/components/GetAlbumsClient.tsx (Client Component)\n//\n\n\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Database } from \"@sqlitecloud/drivers\";\nimport { Album } from \"@/types\";\nimport { GET_ALBUMS } from \"@/constants/queries\";\n\nexport default function GetAlbumsClient() {\n const [albums, setAlbums] = useState([]);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n async function fetchAlbums() {\n let db;\n try {\n console.log(process.env.NEXT_PUBLIC_SQLITECLOUD_URL);\n db = new Database(process.env.NEXT_PUBLIC_SQLITECLOUD_URL!);\n const result = await db.sql(GET_ALBUMS);\n setAlbums(result);\n } catch (error) {\n let message = \"An unknown error occurred\";\n\n if (error instanceof Error) {\n message = error.message;\n }\n setError(message);\n } finally {\n db?.close();\n }\n }\n\n fetchAlbums();\n }, []);\n\n if (error) return

    Error: {error}

    ;\n\n return (\n
    \n

    Albums (Client Component)

    \n {error ? (\n

    Error: {error}

    \n ) : (\n
      \n {albums.map((album) => (\n
    • \n {album.title} -{\" \"}\n {album.artist}\n
    • \n ))}\n
    \n )}\n
    \n );\n}\n```\n\n11. **Update Data in a Client Component** \nYou can also update data directly from a Client Component:\n\n```tsx\n//\n// src/app/components/UpdateAlbumsClient.tsx (Client Component)\n//\n\n\"use client\";\n\nimport { useState, useEffect } from \"react\";\n\nexport default function UpdateAlbumsClient() {\n const [albums, setAlbums] = useState<\n { id: number; title: string; artist: string }[]\n >([]);\n const [loading, setLoading] = useState(false);\n\n // Function to fetch albums from the API route\n async function fetchAlbums() {\n try {\n const res = await fetch(\"/api/albums\");\n if (!res.ok) throw new Error(\"Failed to fetch albums\");\n const data = await res.json();\n setAlbums(data);\n } catch (error) {\n console.error(\"Error fetching albums:\", error);\n }\n }\n\n // Function to add a new album and then reload the albums list\n async function addAlbum() {\n setLoading(true);\n\n try {\n // Generate a random album name\n const randomAlbumTitle = `Album ${Math.random()\n .toString(36)\n .substring(7)}`;\n\n // Generate a random artist ID between 1 and 100\n const randomArtistId = Math.floor(Math.random() * 100) + 1;\n\n const res = await fetch(\"/api/albums\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n title: randomAlbumTitle,\n artistId: randomArtistId,\n }),\n });\n\n if (!res.ok) throw new Error(\"Failed to add album\");\n\n await fetchAlbums(); // Refresh album list after adding\n } catch (error) {\n console.error(\"Error adding album:\", error);\n } finally {\n setLoading(false);\n }\n }\n\n // Fetch albums when component mounts\n useEffect(() => {\n fetchAlbums();\n }, []);\n\n return (\n
    \n \n {loading ? \"Adding...\" : \"Add Album\"}\n \n\n

    Latest Albums

    \n {albums.length === 0 ? (\n

    No albums found.

    \n ) : (\n
      \n {albums.map((album) => (\n
    • \n {album.title} -{\" \"}\n {album.artist}\n
    • \n ))}\n
    \n )}\n
    \n );\n}\n\n```\n\n12. **Create a Page to Display Components**\n\nReplace the content of `page.tsx` with:\n\n```tsx\n//\n// src/app/page.tsx (Unified Page)\n//\n\nimport GetAlbumsClient from \"./components/GetAlbumsClient\";\nimport GetAlbumsServer from \"./components/GetAlbumsServer\";\nimport UpdateAlbumsClient from \"./components/UpdateAlbumsClient\";\n\nexport default function page() {\n return (\n
    \n
    \n

    Albums Overview

    \n\n
    \n \n
    \n\n
    \n \n
    \n\n
    \n \n
    \n
    \n
    \n );\n}\n```\n\nReplace the content of `layout.tsx` with:\n\n```tsx\n//\n// src/app/layout.tsx\n//\n\nexport default function RootLayout({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n \n \n {/* ✅ Add Tailwind CDN */}\n \n \n {children}\n \n );\n}\n\n```\n\n13. **Run Your App**\n```bash\nnpm run dev\n```\n\n14. **View Your App**\n - Open your browser and navigate to the provided localhost link to see your app in action.\n\n\n--- \n\nCongratulations! You’ve successfully built a Next.js app that interacts with a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-next.mdx","digest":"a4cb57ed7f94da11","deferredRender":true,"collection":"docs"}},{"title":"Django","filePath":"quick-start-django","type":"inner","level":1,"entry":{"id":"quick-start-django","data":{"title":"Django Quick Start Guide","description":"Get started with SQLite Cloud using Django.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and Django by building a simple application that connects to and reads from a SQLite Cloud database.\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a Django app**\n - If you haven't already done so, install Python and Django.\n - The following command creates an outer directory (the container for your project) AND an inner directory (the Python package for your project). Both directories will be named `sqlitecloud_quickstart`.\n\n```bash\ndjango-admin startproject sqlitecloud_quickstart\n```\n - The following command creates your app as a separate package within the project container directory.\n\n```bash\ncd sqlitecloud_quickstart\npython manage.py startapp albums\n```\n\n3. **Install the SQLite Cloud Python SDK**\n - Run this command from your current directory (i.e. the outer `sqlitecloud_quickstart`).\n\n```bash\npip install sqlitecloud\n```\n\n4. **App setup**\n - Create a new file `albums/services.py` and copy in the following code.\n - In your SQLite Cloud account dashboard, click on a Node, copy the Connection String, and replace `` below.\n\n```python\nimport sqlitecloud\n\ndef get_albums():\n conn = sqlitecloud.connect('')\n\n db_name = \"chinook.sqlite\"\n db_query = \"SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist FROM albums INNER JOIN artists WHERE artists.ArtistId = albums.ArtistId LIMIT 20\"\n\n conn.execute(f\"USE DATABASE {db_name}\")\n\n cursor = conn.execute(db_query)\n\n conn.close()\n\n result = cursor.fetchall()\n\n return result\n```\n\n - Copy the following code into `albums/views.py`. This view function invokes the `get_albums()` function defined in `services.py` to connect to the database and return album and artist information.\n - The view function converts each returned row from a list to an object to more easily access the information in our HTML template (will discuss further later).\n\n```python\nfrom django.http import HttpResponse\nfrom django.template import loader\nfrom .services import get_albums\n\ndef index(request):\n albumsList = get_albums()\n\n albumObjsList = [{'album': row[1], 'artist': row[2]} for row in albumsList]\n\n template = loader.get_template(\"albums/index.html\")\n context = {\n \"albumObjsList\": albumObjsList,\n }\n return HttpResponse(template.render(context, request))\n```\n\n - Create a new file `albums/urls.py` and copy in the following code. This URL configuration (URLconf) maps the above view to a URL so we can access the view in the browser.\n\n```python\nfrom django.urls import path\nfrom . import views\n\nurlpatterns = [\n path(\"\", views.index, name=\"index\")\n]\n```\n\n - Adjust the code in `sqlitecloud_quickstart/urls.py` to be as follows. We must configure this global URLconf in the inner `sqlitecloud_quickstart` to include the URLconf we defined above in our app.\n\n```python\nfrom django.contrib import admin\nfrom django.urls import include, path\n\n# global URLconfs\nurlpatterns = [\n path(\"albums/\", include(\"albums.urls\")),\n path('admin/', admin.site.urls),\n]\n```\n\n - Now we'll create a Django template the view can use to render HTML. Under `albums`, create a new file at `templates/albums/index.html` and copy in the following code.\n - Bear in mind, there are now 2 (outer and inner) `albums` directories.\n - The `index` view function above is already set up to load and render the template `albums/index.html`. (NOTE: `albums` here is the inner `albums` dir.)\n\n```html\n
    \n

    Albums

    \n
      \n {% for row in albumObjsList %}\n
    • {{ row.album }} by {{ row.artist }}
    • \n {% endfor %}\n
    \n
    \n```\n - Lastly, in `sqlitecloud_quickstart/settings.py`, configure `DIRS` in `TEMPLATES` as follows.\n - `'APP_DIRS': True` tells Django's templating engine to look for template source files inside project apps.\n - `DIRS` provides the filepath to the correct app's `templates` dir.\n\n```python\nTEMPLATES = [\n {\n 'BACKEND': 'django.template.backends.django.DjangoTemplates',\n 'DIRS': ['albums/templates'],\n 'APP_DIRS': True,\n 'OPTIONS': {\n 'context_processors': [\n 'django.template.context_processors.debug',\n 'django.template.context_processors.request',\n 'django.contrib.auth.context_processors.auth',\n 'django.contrib.messages.context_processors.messages',\n ],\n },\n },\n]\n```\n\n5. **Run the Django dev server**\n\n```bash\npython manage.py runserver\n```\n\n - Visit `http://127.0.0.1:8000/albums/` to see your app data.\n\n6. **FOLLOW-UP:**\nThis Quickstart goes a bit deeper into the framework than the other Quickstarts since Django requires more boilerplate to get up-and-running with a simple app.\n\nIf you're new to Django and want to learn more, we referenced the following Django Tutorial pages extensively when writing this Quickstart:\n - Part 1\n - Part 3\n\nAnd that's it! You've successfully built a Django app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-django.mdx","digest":"8129be50fbed66fc","deferredRender":true,"collection":"docs"}},{"title":"Flask","filePath":"quick-start-flask","type":"inner","level":1,"entry":{"id":"quick-start-flask","data":{"title":"Flask Quick Start Guide","description":"Get started with SQLite Cloud using Flask.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and Flask by building a simple application that connects to and reads from a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a Flask app**\n - You should have the latest Python version (3) installed locally.\n\n```bash\nmkdir sqlc-quickstart\ncd sqlc-quickstart\n\npython3 -m venv .venv\n. .venv/bin/activate\n\npip install flask\n```\n\n3. **Install the SQLite Cloud SDK**\n\n```bash\npip install sqlitecloud\n```\n\n4. **Query data**\n - Copy the following code into a new `app.py` file.\n - In your SQLite Cloud account dashboard, click on a Node, copy the Connection String, and replace `` below.\n\n```py\nfrom flask import Flask\nimport sqlitecloud\n\napp = Flask(__name__)\n\n@app.route('/')\ndef get_albums():\n conn = sqlitecloud.connect('')\n\n db_name = 'chinook.sqlite'\n db_query = \"SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist FROM albums INNER JOIN artists WHERE artists.ArtistId = albums.ArtistId LIMIT 20\"\n\n conn.execute(f\"USE DATABASE {db_name}\")\n\n cursor = conn.execute(db_query)\n\n conn.close()\n\n result = '

    Albums

    '\n\n for row in cursor:\n album = f\"{row[1]} by {row[2]}\"\n result += f\"
  • {album}
  • \"\n\n return result + '
    '\n```\n\n5. **Run your app**\n - If you're using port 5000 or on MacOS, also pass the `--port` option to provdie an open port.\n - Pass the --debug option to enable hot reloading and interactive debugging on your dev server.\n\n```bash\nflask run --port 3000 --debug\n```\n\n6. **View your app**\n - Open your browser and navigate to `http://127.0.0.1:3000/` to see your app data.\n - If you're unfamiliar with Flask, the code above calls the `get_albums` function when you load the root URL. The function returns a string with HTML for the browser to render.\n\nAnd that's it! You've successfully built a Flask app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-flask.mdx","digest":"b337ed1f1f5c3411","deferredRender":true,"collection":"docs"}},{"title":"SQLAlchemy","filePath":"quick-start-sqlalchemy-orm","type":"inner","level":1,"entry":{"id":"quick-start-sqlalchemy-orm","data":{"title":"SQLAlchemy ORM Quick Start Guide","description":"Get started with SQLite Cloud using SQLAlchemy ORM in FastAPI.","customClass":"","category":"getting-started","status":"publish"},"body":"In this Quick Start, we will show you how to get started with SQLite Cloud by building a FastAPI backend that connects to and reads from a SQLite Cloud database using SQLAlchemy.\n\nNOTE that FastAPI framework:\n - does NOT require you to use a relational database or any database at all.\n - CAN work with any ORM library (including SQLAlchemy) or database (including SQLite, which comes pre-installed in Python and is a database supported by SQLAlchemy).\n - code is MINIMAL in the example below. Most of the code is standard SQLAlchemy and framework-agnostic.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a new Python project**\n - You should have the latest Python version (3) installed locally.\n\n```bash\nmkdir sqlalchemy-quickstart\ncd sqlalchemy-quickstart\n\n# open the project in VSCode / another editor\ncode .\n\npython3 -m venv .venv\n. .venv/bin/activate\n```\n\n3. **Install dependencies**\n - Run this command from your current directory:\n\n```bash\npip install \"fastapi[standard]\" sqlalchemy sqlalchemy-sqlitecloud\n```\n\n - Do NOT remove the quotes around the FastAPI package.\n - `sqlalchemy-sqlitecloud` includes `sqlitecloud`, so no need to install the latter separately.\n\n4. **App setup**\n - From your current directory, create a sub-directory `fastapi_sqlc_app` with an empty `__init__.py` file to indicate the new sub-directory is a package.\n - NOTE: We will create all remaining project files in this sub-directory.\n\n```bash\nmkdir fastapi_sqlc_app\ncd fastapi_sqlc_app\ntouch __init__.py\n```\n\n - Create a new file `database.py` and copy in the following code.\n - In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `` below. Modify your string to include the name of the DB we'll query: `sqlitecloud://{hostname}:8860/chinook.sqlite?apikey={apikey}`.\n\n```py\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy.ext.declarative import declarative_base\n\nengine = create_engine('')\n\nSessionLocal = sessionmaker(bind=engine)\n\nBase = declarative_base()\n```\n\n - Create a new file `models.py` and copy in the following code defining 2 SQLAlchemy ORM \"models\", or classes, to interact with the DB.\n - `__tablename__` is the name of a model's corresponding DB table.\n - The `Album` class' `id` attribute maps to the `AlbumId` column in the `albums` table. All other class attribute names match their corresponding table column names.\n\n```py\nfrom .database import Base\n\nfrom sqlalchemy import Column, ForeignKey, Integer, String\n\nclass Artist(Base):\n __tablename__ = \"artists\"\n\n ArtistId = Column(Integer, primary_key=True)\n Name = Column(String)\n\nclass Album(Base):\n __tablename__ = \"albums\"\n\n id = Column(\"AlbumId\", Integer, primary_key=True)\n Title = Column(String)\n ArtistId = Column(Integer, ForeignKey('artists.ArtistId'))\n```\n\n - Create a new file `schemas.py` and copy in the following code defining a Pydantic model, or \"schema\", to validate the shape of the response data.\n\n```py\nfrom pydantic import BaseModel\n\nclass AlbumResponse(BaseModel):\n id: int\n Title: str\n ArtistName: str\n```\n\n - Create a new file `read.py` and copy in the following code creating a reusable utility function to read album data.\n\n```py\nfrom . import models\n\nfrom sqlalchemy.orm import Session\n\ndef get_albums(db: Session, skip: int = 0, num: int = 20):\n return db.query(models.Album.id, models.Album.Title, models.Artist.Name.label('ArtistName')).join(models.Artist).offset(skip).limit(num).all()\n```\n\n - Create a new file `main.py` and copy in the following code.\n - The `get_db` function handles creating and closing a new `SessionLocal` instance, or DB connection/ session, for every request.\n - A GET request to the `/albums/` endpoint calls the `read_albums` function, which returns a list of SQLAlchemy `Album` models. The `response_model` ensures only data declared in the Pydantic schema is returned to the client.\n - The `AlbumResponse` Pydantic model in `schemas.py` has `ArtistName`, as opposed to `ArtistId` defined in the `Album` SQLAlchemy model in `models.py`.\n - `read_albums` calls the `get_albums` function in `read.py`. `get_albums` queries the `Album` ORM model/ `albums` DB table for the first 20 albums, and joins the `Artist` ORM model/ `artists` DB table to retrieve the `Artist.Name` (re-labeled `ArtistName`) expected by the `AlbumResponse` Pydantic model.\n\n```py\nfrom .database import SessionLocal\nfrom . import read, schemas\n\nfrom fastapi import FastAPI, Depends\nfrom sqlalchemy.orm import Session\n\napp = FastAPI()\n\ndef get_db():\n db = SessionLocal()\n try:\n yield db\n finally:\n db.close()\n\n@app.get(\"/albums/\", response_model=list[schemas.AlbumResponse])\ndef read_albums(skip: int = 0, num: int = 20, db: Session = Depends(get_db)):\n albums = read.get_albums(db, skip=skip, num=num)\n return albums\n```\n\n5. **Run your FastAPI app**\n - From your `sqlalchemy-quickstart` directory, run the following command:\n\n```bash\nuvicorn fastapi_sqlc_app.main:app --reload\n```\n\n - Visit `http://127.0.0.1:8000/albums/` to see your app data.\n\n6. **Troubleshooting**\n\n - If you encounter the following error, restart your IDE and re-run your app.\n\n```bash\nAttributeError: module 'sqlitecloud.dbapi2' has no attribute 'sqlite_version_info'`\n```\n\n7. **References**\n\n - FastAPI introductory example\n - FastAPI SQL Databases tutorial\n - Latest SQLAlchemy docs\n\nAnd that's it! You've successfully built a FastAPI app that uses SQLAlchemy ORM to read data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-sqlalchemy-orm.mdx","digest":"c11461c9581e87a1","deferredRender":true,"collection":"docs"}},{"title":"Streamlit","filePath":"quick-start-streamlit","type":"inner","level":1,"entry":{"id":"quick-start-streamlit","data":{"title":"Streamlit Quick Start Guide","description":"Get started with SQLite Cloud using Streamlit.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and Streamlit by building a simple application that connects to and reads from a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a Streamlit app**\n - You should have the latest Python version (3) installed locally.\n\n```bash\nmkdir sqlc-quickstart\ncd sqlc-quickstart\n\npython3 -m venv .venv\n. .venv/bin/activate\n\npip install streamlit\n```\n\n3. **Install the SQLite Cloud SDK**\n\n```bash\npip install sqlitecloud\n```\n\n4. **Query data**\n - Copy the following code into a new `app.py` file.\n - In your SQLite Cloud account dashboard, click your Project name, copy the Connection String, and replace `` below.\n\n```py\nimport streamlit as st\nimport sqlitecloud\nimport pandas as pd\n\nst.header('Invoices')\n\nconn = sqlitecloud.connect('')\n\ndb_name = \"chinook.sqlite\"\nconn.execute(f\"USE DATABASE {db_name}\")\n\ninvoices = pd.read_sql(\"SELECT * FROM invoices LIMIT 20\", conn)\n\nst.dataframe(invoices, hide_index=True)\n```\n\n5. **Run your app**\n\n```bash\nstreamlit run app.py\n```\n\n6. **View your app**\n - Open your browser and navigate to the localhost link provided by the previous command to see your app data.\n\nAnd that's it! You've successfully built a Streamlit app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-streamlit.mdx","digest":"fedd5d9235292a17","deferredRender":true,"collection":"docs"}},{"title":"PHP / Laravel","filePath":"quick-start-php-laravel","type":"inner","level":1,"entry":{"id":"quick-start-php-laravel","data":{"title":"PHP / Laravel Quick Start Guide","description":"Get started with SQLite Cloud using PHP and Laravel.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and PHP by building a simple Laravel application that connects to and reads from a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new project.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a Laravel app**\n - If you haven't already done so, install PHP, Laravel, and Composer.\n - If you use macOS, you can install all 3 in 1 click by downloading Laravel Herd, a PHP dev environment.\n - Create a new Laravel project.\n\n```bash\ncomposer create-project laravel/laravel sqlc-quickstart\n```\n\n - In the project directory, start Laravel's local dev server.\n\n```bash\ncd sqlc-quickstart\nphp artisan serve\n```\n\n - Visit `http://127.0.0.1:8000` to see your Laravel app.\n\n3. **Configure a Blade frontend**\n - Open another terminal. Again in your project dir, install Laravel Breeze.\n - By default, Breeze uses simple Blade templates for your app's view layer. Blade is a templating engine included with Laravel. HTML is rendered server-side so you can include dynamic content from your database.\n\n```bash\ncomposer require laravel/breeze --dev\nphp artisan breeze:install blade\n```\n\n - Start a Vite dev server that will hot reload updates to your app. (No need to load the provided localhost link, just keep the Vite server running.)\n\n```bash\nnpm run dev\n```\n\n - Refresh your app in the browser. Click the \"Register\" link at the top right. Register an account and log in. Save your credentials.\n\n4. **App setup**\n\n - Open another terminal. Again in your project dir, run `php artisan make:model -rc Album` to create an Eloquent Model (which we'll ignore) and a HTTP resource controller: `app/Http/Controllers/AlbumController.php`. We'll add functionality to this file to process app requests and return responses later.\n - Replace the code in `routes/web.php` with the following snippet to add a route named `albums.index`.\n - Run `php artisan route:list` to view all your app routes.\n - `albums.index` will route GET requests to the `albums` endpoint to `AlbumController`'s `index` method (will set up later).\n\n```php\nonly(['index']);\n```\n\n - Create a new file `resources/views/albums/index.blade.php` and copy in the following code to create your Blade view template.\n\n```php\n

    Albums

    \n
      \n@foreach ($albums as $album)\n
    • {{ $album['albumTitle'] }} by {{ $album['artistName'] }}
    • \n@endforeach\n
    \n```\n\n5. **Install the SQLite Cloud SDK**\n\n```bash\ncomposer require sqlitecloud/sqlitecloud\n```\n\n6. **Query data**\n\n - Replace the code in `app/Http/Controllers/AlbumController.php` with the following snippet.\n - In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `` below.\n - The `index` method will:\n - connect to and query the database,\n - create an array of arrays `albums` containing each returned album's title and artist,\n - use the global `view` helper to pass `albums` to your view template stored at `resources/views/albums/index.blade.php` (and already set up to list the data), and\n - return the completed Blade view to the browser.\n\n```php\nconnectWithString('');\n\n $db_name = 'chinook.sqlite';\n $db_query = 'SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist FROM albums INNER JOIN artists WHERE artists.ArtistId = albums.ArtistId LIMIT 20';\n\n $sqlite->execute(\"USE DATABASE {$db_name}\");\n \n $rowset = $sqlite->execute($db_query);\n\n $sqlite->disconnect();\n\n $albums = [];\n\n for($i = 0; $i < $rowset->nrows; $i++) {\n $albums[] = [\n 'albumTitle' => $rowset->value($i, 1),\n 'artistName' => $rowset->value($i, 2),\n ];\n }\n \n return view('albums.index', [ \n 'albums' => $albums\n ]);\n }\n}\n```\n\n7. **View your app**\n - Visit `http://127.0.0.1:8000/albums` to see your app data.\n\n8. **FOLLOW-UP:**\nThis Quickstart goes a bit deeper into the framework than the other Quickstarts since Laravel requires more boilerplate to get up-and-running with a simple app.\n\nIf you're new to Laravel and want to learn more, we referenced the following Laravel Tutorial pages extensively when writing this Quickstart:\n - Installation\n - Controllers, Routing, Blade\n\nAnd that's it! You've successfully built a PHP / Laravel app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-laravel.mdx","digest":"959362894b20b904","deferredRender":true,"collection":"docs"}},{"title":"Gin","filePath":"quick-start-gin","type":"inner","level":1,"entry":{"id":"quick-start-gin","data":{"title":"Gin Quick Start Guide","description":"Get started with SQLite Cloud using Gin.","customClass":"","category":"getting-started","status":"publish"},"body":"In this quickstart, we will show you how to get started with SQLite Cloud and Go by building a simple Gin application that connects to and reads from a SQLite Cloud database.\n\n---\n\n1. **Set up a SQLite Cloud account**\n - If you haven't already, sign up for a SQLite Cloud account and create a new database.\n - In this guide, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n2. **Create a Gin app**\n - You should have Go installed locally.\n - Set up your Go workspace.\n```bash\nmkdir sqlc-quickstart\ncd sqlc-quickstart\n\ngo mod init example.com/sqlc-quickstart\n```\n - Create a file called `app.go`.\n - Add the following code to your `app.go` file.\n```go\npackage main\n\nimport \"fmt\"\n```\n - Import the Gin package in your Go source code.\n```go\nimport \"github.com/gin-gonic/gin\"\n```\n - Run the `go mod tidy` command to synchronize your module's dependencies.\n```bash\n$ go mod tidy\ngo: finding module for package github.com/gin-gonic/gin\ngo: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.10.0\ngo: downloading github.com/google/go-cmp v0.5.5\n```\n\n3. **Install the SQLite Cloud package**\n- Import the package in your Go source code.\n```go\nimport sqlitecloud \"github.com/sqlitecloud/sqlitecloud-go\"\n```\n- Download the package, and run the `go mod tidy` command to synchronize your module’s dependencies.\n```bash\n$ go mod tidy \ngo: downloading github.com/sqlitecloud/sqlitecloud-go v1.0.0\n```\n\n4. **Connect with a valid SQLite Cloud connection string**\n```go \nsqlitecloud://{username}:{password}@{host}.sqlite.cloud:8860/{database}\n```\n- To get your admin username, go to your SQLite Cloud account dashboard. In the left nav, open Security and select Users. Your admin username has already been created. Replace `{username}` in the connection string.\n- To set your admin user’s password, click the row’s down chevron and select Edit. Enter a new Password and click Save. Replace `{password}` in the connection string.\n- To get the host, see under your Project name `{host}.sqlite.cloud`.\n- To get the database name, in the left nav, open Databases and select Tables. All of your databases are listed in the Select Database dropdown.\n\n\n5. **Query data**\n - Copy the following code into the `app.go` file. \n - Replace ``.\n\n```go\ntype Artist struct {\n\tArtistID int64 `json:\"artist id\"`\n\tName string `json:\"name\"`\n}\n\nfunc readArtists(resultSet *sqlitecloud.Result) ([]Artist, error) {\n\tvar artists []Artist\n\n\tfor r := uint64(0); r < resultSet.GetNumberOfRows(); r++ {\n\t\tid, err := resultSet.GetInt64Value(r, 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tname, err := resultSet.GetStringValue(r, 1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tartists = append(artists, Artist{\n\t\t\tArtistID: id,\n\t\t\tName: name,\n\t\t})\n\t}\n\n\treturn artists, nil\n}\n\nfunc main() {\n\tr := gin.Default()\n\n\tr.GET(\"/artists\", func(c *gin.Context) {\n\t\tconst connectionString = \"\"\n\n\t\tdb, err := sqlitecloud.Connect(connectionString)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Connect error: \", err)\n\t\t\tpanic(\"Connect error\")\n\t\t}\n\n\t\tdbResult, err := db.Select(\"SELECT * FROM artists LIMIT 10;\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Select error: \", err)\n\t\t\tpanic(\"Select error\")\n\t\t}\n\n\t\tartists, err := readArtists(dbResult)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Read artists error: \", err)\n\t\t\tpanic(\"Read artists error\")\n\t\t}\n\n\t\tc.JSON(200, artists)\n\n\t})\n\n\tr.Run() // listen and serve on 0.0.0.0:8080\n}\n\n```\n\n6. **Run your app**\n\n```bash\n$ go run app.go\n```\n\n7. **View your app**\n - Open your browser and navigate to `localhost:8080/artists`.\n\nAnd that's it! You've successfully built a Gin app that reads data from a SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-gin.mdx","digest":"7dab60b8c96683e1","deferredRender":true,"collection":"docs"}},{"title":"Knex.js","filePath":"quick-start-knex","type":"inner","level":1,"entry":{"id":"quick-start-knex","data":{"title":"Knex.js Integration","description":"Integrate SQLite Cloud with Knex.js, a popular SQL query builder.","customClass":"","category":"getting-started","status":"publish"},"body":"In this tutorial, we'll show you how to connect your TypeScript application to a SQLite Cloud database using the popular SQL builder, Knex.js.\n\n---\n\n**Prerequisites**\n\n- Node.js and npm installed on your system\n- A SQLite Cloud account (you can sign up for a free account here)\n\n1. **How to connect**\n\n- Create a Knex.js instance that uses the SQLite Cloud JavaScript driver to connect to your database.\n\n```typescript\nimport 'dotenv/config'\nimport { knex } from 'knex'\n\nconst Client_SQLite3 = require('knex/lib/dialects/sqlite3')\n\n// client will have sqlite3 dialect, but will use sqlitecloud-js driver\nclass Client_Libsql extends Client_SQLite3 {\n _driver() {\n return require('@sqlitecloud/drivers')\n }\n}\n\n// Create a Knex.js instance with the custom SQLite3 client\nconst db = knex({\n client: Client_Libsql as any,\n connection: {\n filename: process.env.DATABASE_URL as string\n }\n})\n```\n\n2. **Basic Usage**\n\nIn this example, we will use the sample datasets that come pre-loaded with SQLite Cloud.\n\n- Initialize a new Node project:\n\n```bash\nnpm init -y\n```\n\n- Install the required dependencies:\n\n```bash\nnpm install @sqlitecloud/drivers knex dotenv --save\n```\n\n- Install the necessary development dependencies:\n\n```bash\nnpm install @types/node nodemon ts-node typescript --save-dev\n```\n\n- Create a `.env` file in the root of your project and add your SQLite Cloud connection string:\n\n```bash\nDATABASE_URL=\"sqlitecloud://{USER}:{PASSWORD}@{HOST}.sqlite.cloud:8860\"\n```\n\nReplace `{USER}`, `{PASSWORD}`, and `{HOST}` with your actual SQLite Cloud credentials and server hostname.\n\n- Create a `tsconfig.json` file to configure your TypeScript compiler:\n\n```bash\ntsc --init\n```\n\n- Create a new file called `example.ts` and add the following code:\n\n```typescript\nimport 'dotenv/config'\nimport { knex } from 'knex'\n\nconst Client_SQLite3 = require('knex/lib/dialects/sqlite3')\n\nclass Client_Libsql extends Client_SQLite3 {\n _driver() {\n return require('@sqlitecloud/drivers')\n }\n}\n\nconsole.assert(process.env.DATABASE_URL, 'Define DATABASE_URL environment variable')\n\nconst db = knex({\n client: Client_Libsql as any,\n connection: {\n filename: process.env.DATABASE_URL as string\n }\n})\n\ndb.raw('USE DATABASE chinook.sqlite; SELECT * FROM customers')\n .then(result => {\n console.log(`Connected to database via knex and received ${result.length} rows`)\n console.log(JSON.stringify(result, null, 2))\n db.destroy()\n })\n .catch(err => {\n console.error(err)\n db.destroy()\n })\n```\n\n- Update your `package.json` file to include a script for running the example:\n\n```bash\n{\n \"scripts\": {\n \"dev\": \"nodemon --exec ts-node example.ts\"\n }\n}\n```\n\n- Start the development server:\n\n```bash\nnpm run dev\n```\n\nThis will run the `example.ts` file using `ts-node` and will automatically restart the server when you make changes to your code.\n\n- Observe the output in the console, which should display the customer data fetched from the SQLite Cloud database.\n```bash\n [\n {\n \"CustomerId\": 1,\n \"FirstName\": \"Luís\",\n \"LastName\": \"Gonçalves\",\n \"Company\": \"Embraer - Empresa Brasileira de Aeronáutica S.A.\",\n \"Address\": \"Av. Brigadeiro Faria Lima, 2170\",\n \"City\": \"São José dos Campos\",\n \"State\": \"SP\",\n \"Country\": \"Brazil\",\n \"PostalCode\": \"12227-000\",\n \"Phone\": \"+55 (12) 3923-5555\",\n \"Fax\": \"+55 (12) 3923-5566\",\n \"Email\": \"luisg@embraer.com.br\",\n \"SupportRepId\": 3\n },\n ]\n```\n\nAnd that's it! You've successfully connected your TypeScript application to a SQLite Cloud database using Knex.js.","filePath":"docs-website/content/docs/sqlite-cloud/quickstart/quick-start-knex.mdx","digest":"c6109c71a8535ba9","deferredRender":true,"collection":"docs"}},{"title":"Edge Functions","filePath":"edge-functions","type":"inner","level":0,"entry":{"id":"edge-functions","data":{"title":"Edge Functions","description":"SQLite Cloud offers powerful edge functions for performant data processing and third-party integrations.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport edgeFunctions from '@docs-website-assets/introduction/video/dashboard_edge_functions.mp4';\n\nimport Callout from \"@commons-components/Information/Callout.astro\";\n\nEdge functions let you define custom logic to run on the same nodes as your database files for ultra-fast performance.\n\nYou can write edge functions directly in the SQLite Cloud dashboard using JavaScript, TypeScript, or SQL. Importing modules is not currently supported.\n\nEdge functions can be called remotely over HTTP or Websockets via API, or triggered by database events via SQLite Cloud Webhooks. Each function runs in an isolated environment using the Bun runtime. \n\nTurning on linearizable reads ensures strong consistency, but may introduce some latency. When eventual consistency is sufficient, we recommend leaving linearizable reads off.\n\n---\n\n## Getting Started\n\nUse the **Edge Functions panel** to effortlessly create, deploy, and test Edge Functions directly in the SQLite Cloud dashboard. \nThe editor allows you to choose the language of your function — **JavaScript**, **TypeScript**, or **SQL** — and connect it to the database of your choice.\n\nOnce deployed, the function can be tested immediately in the dashboard or invoked externally through its Function URL.\n\n\n\n#### Note:\nFunctions should return a JSON-serializable object with a data field:\n```js\nreturn {\n data: {\n // your return object\n }\n}\n```\n\n\n\n\nEnabling **linearizable reads** guarantees strong consistency but may introduce additional latency. \nFor most cases, we recommend keeping it disabled to benefit from lower response times.\n\n\n\n### Function Details\n\nIn the **Details** tab you will find key information about your function, including:\n\n- The **last deployment date and time** \n- The **Function URL**, which you can use to call the function from external applications \n\n![Edge Function Details](@docs-website-assets/introduction/dahsboard-edge-function-details.png)\n\n\n\n### Authorization\nEdge functions that access your SQLite databases must be authorized via API key. \n\nAn API key must be sent in the request url as a query parameter (`?apikey=YOUR_API_KEY`) or as an attribute in the request body (`{ apikey: YOUR_API_KEY }`).\n\n### Execution\n\nEdge functions can be called via HTTP GET and POST methods. You can pass additional values to your edge function in two ways:\n- Query parameters: Accessible via `request.params`\n- Request body: Accessible via `request.data`\n\n---\n\n## Guides\n### Interacting with your Database\nUse the global `connection` object to access and manipulate your database.\n```js\nconst customers = await connection.sql`SELECT * FROM customers;`\nreturn {\n data: customers\n}\n```\n\nSelect the database you would like to access from the \"Database\" dropdown, or select the database you want to use in your SQL query with the USE command.\n\n```js\nconst customers = await connection.sql`USE DATABASE chinook.sqlite; SELECT * FROM customers;`;\nreturn {\n data: customers\n}\n```\n\n### Storing and Accessing Environment Variables\nEnvironment variables can be accessed and stored with the ENV command. ENV variables are stored in the server settings file and are project-specific.\nUse the following commands to set and read values in your server settings file:\n\n* LIST ENV\n* SET ENV key VALUE value\n* GET ENV key\n* REMOVE ENV key\n\nYou can also add environment variables in the UI by navigating to the \"Environment Variables\" section and clicking the \"Create\" button.\n\n\n### Handling Errors\nIn case of error we return an HTTP error code and a JSON with the error message. Manually throwing an error in your code results in a 500 response. You may also return an error. \n\n\n--- \n\n## Examples\n\n### Assigning and Notifying a Support Rep on User Sign up\n\n```js\n// Get secret from database\nconst slackWebhookEndpoint = await connection.sql`GET ENV slack_webhook_endpoint`;\n\n// Get record sent in body via webhook\nconst content = request.data;\nconst database = content.database;\nconst primaryKey = content.data[0];\nconst newCustomer = await connection.sql`USE DATABASE ${database}; SELECT * FROM customers WHERE CustomerId = ${primaryKey};`;\n\n// Sample business logic - assign and notify support rep\n// Get reps from database\nconst reps = await connection.sql`SELECT id, name, country FROM reps`;\nconst rep = reps.find(({ country }) => country === newCustomer.country.toLowerCase());\n\n// Define helpers to assign and notify\nconst assignRep = async (repId, customerId) => await connection.sql`UPDATE customers SET SupportRepId = ${repId} WHERE CustomerId = ${customerId}`;\nconst notifyRep = async (repName, customer) => {\n const message = `@${repName}: New User Sign Up - ${JSON.stringify(customer)}`\n try {\n await fetch(slackWebhookEndpoint, { body: JSON.stringify({ text: message }), method: 'POST', 'Content-type': 'application/json' });\n } catch (err) {\n await fetch(slackWebhookEndpoint, { body: JSON.stringify({ text: err }), method: 'POST', 'Content-type': 'application/json' });\n }\n} \n\n// Call async functions\nawait assignRep(rep.id, newCustomer.id);\nawait notifyRep(rep.name, newCustomer);\n\nreturn {\n data: 'OK'\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/platform/edge-functions.mdx","digest":"bd0ae15bbfe337a1","deferredRender":true,"collection":"docs"}},{"title":"Webhooks","filePath":"webhooks","type":"inner","level":0,"entry":{"id":"webhooks","data":{"title":"Webhooks","description":"Utilize the Webhooks panel to effortlessly establish real-time notifications for write operations within your SQLite database.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport webhooksUrl from '@docs-website-assets/introduction/video/dashboard_webhooks_trigger_url.mp4';\nimport webhooksEdgeFunction from '@docs-website-assets/introduction/video/dashboard_webhooks_trigger_edge_function.mp4.mp4';\n\n**Webhooks** are HTTP callbacks that allow your applications to receive real-time notifications when specific events occur. In the context of SQLite Cloud, webhooks make it easy to build reactive systems by automatically sending notifications when data changes happen within your databases.\n\n\n---\n\n\n## Real-Time Notifications for Database Writes\n\n\nUse the **Webhooks panel** to effortlessly create real-time notifications for write operations—such as inserts, updates, or deletes—within your SQLite Cloud database.\n\nFor example, you can configure SQLite Cloud to notify a webhook.site endpoint every time a write operation occurs on the `albums` table of the `chinook.sqlite` database.\n\n\n\n---\n\n## Change Data Capture\n\nChange Data Webhooks let you send structured HTTP requests to any external service whenever a row in a specific database and/or table is modified. These webhooks include:\n\n* **Database name**\n* **Table name**\n* **Operation type** (insert, update, delete)\n* **Changed row data**\n\nThis enables seamless integration with logging systems, monitoring dashboards, or external APIs that react to database activity.\n\n\n### Payload Fields\n\n```json\n{\n \"type\": \"insert\",\n \"database\": \"chinook.sqlite\",\n \"table\": \"albums\",\n \"column\": [\n \"AlbumId\"\n ],\n \"data\": [\n 349\n ],\n \"webhook\": {\n \"id\": 1,\n \"action\": \"https://webhook.site/70792a3c-2a18-4a48-9ded-df1c90e758ce\",\n \"options\": {\n \"type\": \"url\"\n }\n }\n}\n```\n\n* **type** – The operation type (`insert`, `update`, or `delete`).\n* **database** – The name of the database where the change occurred.\n* **table** – The table affected by the operation.\n* **column** – An array listing the column(s) involved in the operation.\n* **data** – The values corresponding to the affected row(s).\n* **webhook** – Metadata about the webhook itself, including its unique `id`, target `action` (URL or Edge Function), and configuration `options`.\n\n---\n\n## Security\n\nUpon creation, each webhook is assigned a **secret key** used to verify the authenticity of incoming requests.\n\n![Dashboard Projects](@docs-website-assets/introduction/dashboard_webhook_secret.png)\n\n---\n\n## Trigger Edge Functions\n\nWebhooks in SQLite Cloud aren't limited to data capture—they can also **trigger Edge Functions**:\n\n* Via HTTP or WebSocket\n* In response to database write events\n\n\n\nWithin an Edge Function, the webhook payload containing the **Change Data Capture** information is directly accessible through the `request.data` variable, which is available by default in all Edge Functions. \n\n```js\n// Get secret from database\nconst slackWebhookEndpoint = await connection.sql`GET ENV slack_webhook_endpoint`;\n\n// Get record sent in body via webhook\nconst content = request.data;\n\n// Define helpers to assign and notify\nconst notifyRep = async ( ) => {\n await fetch(slackWebhookEndpoint, { body: JSON.stringify({ text: \"Discover the Latest Album Releases\" + JSON.stringify(request.data)}), method: 'POST', 'Content-type': 'application/json' });\n} \n\n// Call async functions\nawait notifyRep();\n\nreturn {\n data: 'OK'\n}\n```\n\nThis allows developers to build distributed, event-driven applications that react immediately to changes at the edge.","filePath":"docs-website/content/docs/sqlite-cloud/platform/webhooks.mdx","digest":"a327e7abebd0cab7","deferredRender":true,"collection":"docs"}},{"title":"Pub/Sub","filePath":"pub-sub","type":"inner","level":0,"entry":{"id":"pub-sub","data":{"title":"Pub/Sub","description":"Pub/Sub is a messaging pattern that allows multiple applications to communicate with each other asynchronously.","customClass":"","category":"platform","status":"publish"},"body":"# SQLiteCloud Pub/Sub System\n\n**Publish/Subscribe (Pub/Sub)** is a messaging pattern that enables asynchronous communication between multiple applications. In the context of **SQLiteCloud**, Pub/Sub provides a robust way to deliver real-time updates or custom messages to subscribed clients when data changes or explicit notifications are issued.\n\nThis feature is particularly useful for building reactive applications, synchronizing distributed systems, and enabling event-driven architectures around your SQLite databases.\n\n---\n\n## Core Concepts\n\n### **Publishers**\n\nPublishers are entities that send messages or notifications. In **SQLiteCloud**, a publisher can:\n\n* Modify a database (triggering automatic Pub/Sub events on commit).\n* Explicitly send a message using the `NOTIFY` command, even without making changes to the database.\n\nAny client with write access—such as a web server, mobile app, or background process—can act as a publisher.\n\n### **Subscribers**\n\nSubscribers are clients that listen for messages or data change events. They can subscribe to:\n\n* A **channel** representing a database table (to receive change events).\n* A **named message channel** (for general-purpose messages).\n\nSubscribers will receive all messages published on the channels they subscribe to.\n\n### **Channels**\n\nChannels are the communication endpoints used for Pub/Sub messaging. A channel can be:\n\n* A **database table name**, used to deliver change notifications.\n* A **custom channel name**, used to send arbitrary messages.\n\nChannels are **not bound** to any database entity unless explicitly tied to a table.\n\n---\n\n## Benefits of Pub/Sub in SQLiteCloud\n\n* **Real-time Updates**\n Instantly notify subscribers when data changes. Useful for dashboards, live feeds, or collaborative apps.\n\n* **Scalability**\n One publisher can broadcast to many subscribers with minimal overhead on the database.\n\n* **Message Filtering**\n Subscribers can choose specific channels, reducing unnecessary data traffic.\n\n* **Fault Tolerance**\n Notifications are delivered reliably. If a subscriber or publisher disconnects, the system continues to function without losing messages.\n\n---\n\n## Payload Format\n\nAll Pub/Sub messages in **SQLiteCloud** are delivered as **JSON** objects. The structure of the payload depends on the type of event:\n\n### 1. **NOTIFY Message Payload**\n\nSent explicitly by clients using the `NOTIFY` command.\n\n```json\n{\n \"sender\": \"UUID\",\n \"channel\": \"name\",\n \"channel_type\": \"MESSAGE\",\n \"payload\": \"Message content here\"\n}\n```\n\n* **sender**: UUID of the client that sent the message.\n* **channel**: Target channel name.\n* **channel\\_type**: Always `\"MESSAGE\"` for this type.\n* **payload**: Optional message content.\n\n---\n\n### 2. **Database Table Change Payload**\n\nGenerated automatically when a transaction modifies a subscribed table. Triggered at **COMMIT** time and may include multiple row operations.\n\n```json\n{\n \"sender\": \"UUID\",\n \"channel\": \"tablename\",\n \"channel_type\": \"TABLE\",\n \"sqlite_pk_name\": [\"id\", \"col1\"],\n \"payload\": [\n {\n \"sqlite_type\": \"INSERT\",\n \"id\": 12,\n \"col1\": \"value1\",\n \"col2\": 3.14\n },\n {\n \"sqlite_type\": \"DELETE\",\n \"sqlite_pk_value\": [13]\n },\n {\n \"sqlite_type\": \"UPDATE\",\n \"id\": 15,\n \"col1\": \"newvalue\",\n \"col2\": 0.0,\n \"sqlite_pk_value\": [14]\n }\n ]\n}\n```\n\n#### Field Descriptions:\n\n* **sender**: UUID of the client initiating the change, or `0` if triggered by the server.\n* **channel**: Table name where the change occurred.\n* **channel\\_type**: `\"TABLE\"`.\n* **sqlite\\_pk\\_name**: Array of primary key column names for the table.\n* **payload**: Array of individual row operations.\n\n * **sqlite\\_type**: `\"INSERT\"`, `\"UPDATE\"`, or `\"DELETE\"`.\n * **sqlite\\_pk\\_value**: Previous primary key values (used in `DELETE` or `UPDATE`).\n * Other keys represent column values (for `INSERT` and `UPDATE`).\n\n> **Tip:** If a client is subscribed to a channel and also publishes to it, it will receive its own notifications. Use the **sender UUID** to filter out self-generated events if needed.\n\n---\n\n## Example SQL Usage\n\n```sql\n> USE DATABASE test.sqlite\nOK\n\n> GET SQL foo\nCREATE TABLE \"foo\" (\n \"id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n \"col1\" TEXT,\n \"col2\" TEXT\n)\n\n> LISTEN TABLE foo\nOK\n```\n\n---\n\n## Example Event Payloads\n\n### DELETE\n\n```sql\nDELETE FROM foo WHERE id=14;\n```\n\n```json\n{\n \"sender\": \"b7a92805-ef82-4ad1-8c2f-92da6df6b1d5\",\n \"channel\": \"foo\",\n \"channel_type\": \"TABLE\",\n \"sqlite_pk_name\": [\"id\"],\n \"payload\": [{\n \"sqlite_type\": \"DELETE\",\n \"sqlite_pk_value\": [14]\n }]\n}\n```\n\n---\n\n### INSERT\n\n```sql\nINSERT INTO foo(col1, col2) VALUES ('test100', 'test101');\n```\n\n```json\n{\n \"sender\": \"b7a92805-ef82-4ad1-8c2f-92da6df6b1d5\",\n \"channel\": \"foo\",\n \"channel_type\": \"TABLE\",\n \"sqlite_pk_name\": [\"id\"],\n \"payload\": [{\n \"sqlite_type\": \"INSERT\",\n \"id\": 15,\n \"col1\": \"test100\",\n \"col2\": \"test101\"\n }]\n}\n```\n\n---\n\n### UPDATE (Primary Key Changed)\n\n```sql\nUPDATE foo SET id=14, col1='test200' WHERE id=15;\n```\n\n```json\n{\n \"sender\": \"b7a92805-ef82-4ad1-8c2f-92da6df6b1d5\",\n \"channel\": \"foo\",\n \"channel_type\": \"TABLE\",\n \"sqlite_pk_name\": [\"id\"],\n \"payload\": [\n {\n \"sqlite_type\": \"DELETE\",\n \"sqlite_pk_value\": [15]\n },\n {\n \"sqlite_type\": \"INSERT\",\n \"id\": 14,\n \"col1\": \"test200\",\n \"col2\": \"test101\"\n }\n ]\n}\n```\n\n---\n\n## Summary\n\nSQLiteCloud's Pub/Sub system enables:\n\n* Real-time data sync across applications.\n* Lightweight messaging between distributed components.\n* Fine-grained, reliable notifications with minimal overhead.\n\nBy leveraging Pub/Sub, developers can build responsive, event-driven applications that scale seamlessly and remain in sync with the database state.\n\n## Client Library Examples\n\n```javascript\nimport { Database } from '@sqlitecloud/drivers'\nimport { PubSub, PUBSUB_ENTITY_TYPE } from '@sqlitecloud/drivers/lib/drivers/pubsub'\n\nlet database = new Database('sqlitecloud://user:password@xxx.sqlite.cloud:8860/chinook.sqlite')\n// or use sqlitecloud://xxx.sqlite.cloud:8860?apikey=xxxxxxx\n\nconst pubSub: PubSub = await database.getPubSub()\n\nawait pubSub.listen(PUBSUB_ENTITY_TYPE.TABLE, 'albums', (error, results, data) => {\n if (results) {\n // Changes on albums table will be received here as JSON object\n console.log('Received message:', results)\n }\n})\n\nawait database.sql`INSERT INTO albums (Title, ArtistId) values ('Brand new song', 1)`\n\n// Stop listening changes on the table\nawait pubSub.unlisten(PUBSUB_ENTITY_TYPE.TABLE, 'albums')\n```","filePath":"docs-website/content/docs/sqlite-cloud/platform/pub-sub.mdx","digest":"400663726cd473a7","deferredRender":true,"collection":"docs"}},{"title":"Users and Roles","filePath":"security","type":"inner","level":0,"entry":{"id":"security","data":{"title":"Security and Access Control","description":"SQLite Cloud provides secure access to resources through role-based authorization, which ensures user isolation and enhances security and manageability.","customClass":"","category":"platform","status":"publish"},"body":"## Users\nSQLite Cloud provides secure access to resources through role-based authorization, which ensures user isolation and enhances security and manageability. In SQLite Cloud, roles serve as the foundation blocks for user access, and the level of user access to the database system is determined by the assigned roles. Users have no access to the system outside the designated roles.\n\nTo add new users to your cluster, simply click on the **Create User** button.\n\n![Dashboard Create User](@docs-website-assets/introduction/dashboard_create_user.png)\n\nOnce a user is successfully created, you can assign one or more roles to them to determine their level of access to the system.\n\n---\n\n## Roles\nIn SQLite Cloud, a role is a set of permissions that allows a user to perform specific actions on a particular resource, such as a database or table. Users can have multiple roles, which determine their access to the system.\n\nYou can assign roles to users in two ways: when creating a new user account, or when updating the roles of an existing user.\n\nThere are two types of roles in SQLite Cloud:\n\n- **Built-In Roles.** These roles are pre-defined by SQLite Cloud to provide commonly needed privileges in a database system. Built-in roles grant permissions on any database.\n\n- **User-Defined Roles.** If the built-in roles do not provide the necessary privileges or if you need to grant permissions for a specific set of resources, you can define custom roles using the **CREATE ROLE** button. These roles are called user-defined roles.\n\n\n![Dashboard Roles](@docs-website-assets/introduction/dashboard_roles.png)\n\n### Built-in roles\nimport Callout from \"@commons-components/Information/Callout.astro\"; \n\nSQLite Cloud offers a comprehensive system of built-in roles designed to provide essential privileges within a database framework. These roles can be assigned using the GRANT ROLE command, and custom roles can be created with the CREATE ROLE command. Privileges represent fundamental operations that can be executed on specific databases or tables and can be granted, revoked, or assigned to specific roles.\n\nHere is an overview of the built-in roles:\n\n- **ADMIN**: This role possesses the highest level of privileges, with unrestricted access to all assigned permissions.\n- **READ**: Grants read-only access to a specified database or table.\n- **READANYDATABASE**: Provides read-only access to any database and table.\n- **READWRITE**: Offers both read and write functionality for a specified database or table.\n- **READWRITEANYDATABASE**: Grants read and write capabilities across any database and table.\n- **DBADMIN**: Allows for administrative tasks like indexing and statistics gathering but doesn't manage users or roles.\n- **DBADMINANYDATABASE**: Provides administrative functions for any database.\n- **USERADMIN**: Enables the creation and modification of roles and users.\n- **CLUSTERADMIN**: Empowers users to manage and monitor the cluster.\n- **CLUSTERMONITOR**: Offers read-only access to cluster monitoring commands.\n- **HOSTADMIN**: Allows monitoring and management of individual nodes.\n- **SUB**: Grants the subscribe privilege to a specified database, table, or channel.\n- **SUBANYCHANNEL**: Provides the subscribe privilege for any channel or table.\n- **PUB**: Offers the publish privilege to a specified database, table, or channel.\n- **PUBANYCHANNEL**: Grants the publish privilege for any channel or table.\n- **PUBSUB**: Combines subscribe and publish privileges for a specified database, table, or channel.\n- **PUBSUBANYCHANNEL**: Combines subscribe and publish privileges for any channel or table.\n- **PUBSUBADMIN**: Allows the creation and removal of channel privileges for a specified database or channel.\n- **PUBSUBADMINANYCHANNEL**: Permits the creation and removal of channel privileges for any channel.\n\n\n\nTo further refine the scope of a role or privilege, you can specify a database and table name during the [CREATE ROLE](/docs/role-commands), [GRANT ROLE](/docs/role-commands), GRANT PRIVILEGE and SET PRIVILEGE commands, as well as during the CREATE USER command. If `NULL` is used, it means that the role or privilege is not assigned and cannot function without specifying a database and table name combination. To extend the validity to any database and table, you can utilize the special `*` character.\n\n\n```bash\n>> LIST ROLES\n-----------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------|--------------|-----------|\n rolename | builtin | privileges | databasename | tablename |\n-----------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------|--------------|-----------|\n ADMIN | 1 | READ,INSERT,UPDATE,DELETE,READWRITE,PRAGMA,CREATE_TABLE,CREATE_INDEX,CREATE_VIEW, | | |\n | | CREATE_TRIGGER,DROP_TABLE,DROP_INDEX,DROP_VIEW,DROP_TRIGGER,ALTER_TABLE,ANALYZE,\t\t\t\t\t\t\t\t\t\t\t\t\t\t | | |\n | | ATTACH,DETACH,DBADMIN,SUB,PUB,PUBSUB,BACKUP,RESTORE,DOWNLOAD,PLUGIN,SETTINGS,USERADMIN,\t\t\t\t\t\t\t\t\t\t\t\t | | |\n | | CLUSTERADMIN,CLUSTERMONITOR,CREATE_DATABASE,DROP_DATABASE,HOSTADMIN,SWITCH_USER,PUBSUBCREATE,PUBSUBADMIN,WEBLITE,ADMIN \t\t\t\t | NULL | NULL |\n READ | 1 | READ | NULL | NULL |\n READANYDATABASE | 1 | READ | * | * |\n READWRITE | 1 | READ,INSERT,UPDATE,DELETE,READWRITE | NULL | NULL |\n READWRITEANYDATABASE | 1 | READ,INSERT,UPDATE,DELETE,READWRITE | * | * |\n DBADMIN | 1 | READ,INSERT,UPDATE,DELETE,READWRITE,PRAGMA,CREATE_TABLE,CREATE_INDEX,CREATE_VIEW, | | |\n | | CREATE_TRIGGER,DROP_TABLE,DROP_INDEX,DROP_VIEW,DROP_TRIGGER,ALTER_TABLE,ANALYZE,ATTACH,DETACH,DBADMIN | NULL | NULL |\n DBADMINANYDATABASE | 1 | READ,INSERT,UPDATE,DELETE,READWRITE,PRAGMA,CREATE_TABLE,CREATE_INDEX,CREATE_VIEW,\t\t\t\t\t\t\t\t\t\t\t\t\t | | |\n | | CREATE_TRIGGER,DROP_TABLE,DROP_INDEX,DROP_VIEW,DROP_TRIGGER,ALTER_TABLE,ANALYZE,ATTACH,DETACH,DBADMIN | * | * |\n USERADMIN | 1 | USERADMIN | * | * |\n CLUSTERADMIN | 1 | CLUSTERADMIN | * | * |\n CLUSTERMONITOR | 1 | CLUSTERMONITOR | * | * |\n HOSTADMIN | 1 | BACKUP,RESTORE,DOWNLOAD,CREATE_DATABASE,DROP_DATABASE,HOSTADMIN | * | * |\n SUB | 1 | SUB | NULL | NULL |\n SUBANYCHANNEL | 1 | SUB | * | * |\n PUB | 1 | PUB | NULL | NULL |\n PUBANYCHANNEL | 1 | PUB | * | * |\n PUBSUB | 1 | SUB,PUB,PUBSUB | NULL | NULL |\n PUBSUBANYCHANNEL | 1 | SUB,PUB,PUBSUB | * | * |\n PUBSUBADMIN | 1 | SUB,PUB,PUBSUB,PUBSUBCREATE,PUBSUBADMIN | NULL | NULL |\n PUBSUBADMINANYCHANNEL | 1 | SUB,PUB,PUBSUB,PUBSUBCREATE,PUBSUBADMIN | * | * |\n-----------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------|--------------|-----------|\n```\n\n## Privileges\nIn a role-based access control system, a privilege represents a specific action or permission that a user or role is allowed to perform within the system.\nIt defines what a user can or cannot do, such as reading, writing, or managing certain resources like tables, databases, or settings.\nEssentially, a privilege is a **right** or **ability** granted to a user or role, specifying their level of access and control over the system's resources.\n\nA privilege can be granted, revoked and assigned to a given role.\nA role can contains any combination of privileges.\n\n```bash\n>> LIST PRIVILEGES\n-----------------|\n name |\n-----------------|\n NONE |\n READ |\n INSERT |\n UPDATE |\n DELETE |\n READWRITE |\n PRAGMA |\n CREATE_TABLE |\n CREATE_INDEX |\n CREATE_VIEW |\n CREATE_TRIGGER |\n DROP_TABLE |\n DROP_INDEX |\n DROP_VIEW |\n DROP_TRIGGER |\n ALTER_TABLE |\n ANALYZE |\n ATTACH |\n DETACH |\n DBADMIN |\n SUB |\n PUB |\n PUBSUB |\n BACKUP |\n RESTORE |\n DOWNLOAD |\n PLUGIN |\n SETTINGS |\n USERADMIN |\n CLUSTERADMIN |\n CLUSTERMONITOR |\n CREATE_DATABASE |\n DROP_DATABASE |\n HOSTADMIN |\n SWITCH_USER |\n PUBSUBCREATE |\n PUBSUBADMIN |\n WEBLITE |\n ADMIN |\n-----------------|\n```\n\n{/*\n## IP Restrictions\nThe IP Restrictions panel enables the restriction of access for a role or user by allowing only specific IP addresses or ranges in CIDR notation (for example 10.10.10.0/24). Both IPv4 and IPv6 addresses are supported.\n\nTo add a new IP restriction to a user or role, click on the **Add IP** button.\n\n![Dashboard Create IP Restriction](@docs-website-assets/introduction/dashboard_create_ip.png)\n\nThe IP Restrictions table will display all current IP restrictions for the selected user or role.\n\n![Dashboard List IP Restrictions](@docs-website-assets/introduction/dashboard_list_ip.png)\n*/}","filePath":"docs-website/content/docs/sqlite-cloud/platform/security.mdx","digest":"15ff9d59673579e6","deferredRender":true,"collection":"docs"}},{"title":"API Keys","filePath":"apikey","type":"inner","level":0,"entry":{"id":"apikey","data":{"title":"Security and Access Control","description":"SQLite Cloud provides secure access to resources through role-based authorization, which ensures user isolation and enhances security and manageability.","customClass":"","category":"platform","status":"publish"},"body":"## API KEYs \n\nAPI KEYs can be used as an alternative authentication mechanism.\nAuthentication through API keys ensures the same privileges as the user to which they are associated.\nAPI KEYs are recommended for all server-to-server authentication cases and are necessary for using the REST APIs and the SDKs that uses the WebSocket APIs.\n\nTo create an API key for a user, click on the **Create API KEY** button.\n\n![Dashboard Create APIKEY](@docs-website-assets/introduction/dashboard_create_apikey.png)\n\nThe resulting table will display all the API keys associated with each user, along with their name.\n![Dashboard List APIKEY](@docs-website-assets/introduction/dashboard_list_apikey.png)","filePath":"docs-website/content/docs/sqlite-cloud/platform/apikey.mdx","digest":"6ec9f8fd5d4ac29b","deferredRender":true,"collection":"docs"}},{"title":"Row-Level Security","filePath":"rls","type":"inner","level":0,"entry":{"id":"rls","data":{"title":"Row-Level Security","description":"Configure fine-grained access control policies to determine which rows in a table a user can access.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport rlsEnable from '@docs-website-assets/introduction/video/dashboard_rls_enable.mp4';\nimport rlsTest from '@docs-website-assets/introduction/video/dashboard_rls_test.mp4';\n\nimport Callout from \"@commons-components/Information/Callout.astro\";\n\nRow-Level Security (RLS) allows you to define fine-grained access control policies that determine which rows in a table a user can access. This ensures that users can only view or modify data they are authorized to see, enhancing data security and privacy.\n\n\nRLS rules only affect users who are authenticated using [Access Tokens](/docs/access-tokens). Admins, APIKEYs, or other non-token users are not restricted by RLS.\n\n\nRLS is a powerful feature for building secure, multi-tenant applications. When combined with SQLite Sync, it enables you to create robust **local-first apps** where user data is stored on the device for offline availability and superior performance.\n\nThis architecture simplifies development by allowing your application to interact with a local database while SQLite Cloud [OffSync](/docs/offsync) transparently handles the synchronization with a central database. RLS ensures that each user's data is securely isolated during this process. The centralized database can then be used for powerful business analytics and reporting across all tenants, without compromising individual data privacy.\n\n---\n\n## Policy Enforcement\n\nRLS in SQLite Cloud operates based on the following principles:\n\nAccess is denied by default.\n\nUnless explicitly allowed by RLS rules, access is blocked. Specifically:\n\n- If RLS is enabled and rules are defined, only permitted operations will succeed.\n- If RLS is enabled but a rule is missing for an operation (e.g., `SELECT`), that operation will be denied.\n- If RLS is not enabled or not configured for a table, token-authenticated users won't see any rows at all.\n\nTo make data accessible to token-authenticated users, you must both enable RLS for the table and define rules for the desired operations (like `SELECT`, `INSERT`, etc.).\n\nOtherwise, they will be blocked from accessing any rows.\n\n---\n\n## Configuring RLS\n\nYou can configure RLS policies for your databases through the SQLite Cloud dashboard.\n\n\n\n1. **Navigate to the Databases Page**: From the main dashboard, go to the \"Databases\" page.\n2. **Select the RLS Column**: In the list of your databases, click on the button in the \"RLS\" column for the desired database.\n3. **Configure RLS Settings**: On the RLS settings page, you can define the policies for each table.\n\n\n For each table, you can specify the following RLS policies:\n\n - **SELECT**: A SQL expression that determines which rows a user can `SELECT`.\n - **INSERT**: A SQL expression that determines if a user can `INSERT` a new row.\n - **UPDATE**: A SQL expression that determines which rows a user can `UPDATE`.\n - **DELETE**: A SQL expression that determines which rows a user can `DELETE`.\n\n \n The SQL expressions can be any valid SQLite expression that returns a boolean value. You can use built-in SQLite functions, and even custom functions to define your policies.\n \n\n### User Information Functions\n\nTo help you create dynamic RLS policies, SQLite Cloud provides two functions to retrieve information about the current authenticated user:\n\n- `auth_userid()`: Returns the `userid` of the current token-authenticated user.\n- `auth_json()`: Returns a JSON object with all the details of the current token-authenticated user, including `user_id`, `name`, `attributes`, `created_at`, and `expires_at`.\n\nThese functions are particularly useful for creating policies that are based on user attributes.\n\nFor more information on Access Tokens, see the [Access Tokens documentation](/docs/access-tokens). The API Documentation for the Access Tokens API can be found in the Weblite section in the Dashboard.\n\n### OLD and NEW References\n\nYour RLS policies for `INSERT`, `UPDATE`, and `DELETE` operations can reference column values as they are being changed. This is done using the special `OLD.column` and `NEW.column` identifiers. Their availability and meaning depend on the operation being performed:\n\n| Operation | `OLD.column` Reference | `NEW.column` Reference |\n| :--- | :--- | :--- |\n| `INSERT` | Not available | The value for the new row. |\n| `UPDATE` | The value of the row *before* the update. | The value of the row *after* the update. |\n| `DELETE` | The value of the row being deleted. | Not available |\n\n---\n\n## Testing RLS\n\n\n\nTo verify that your Row-Level Security (RLS) policies work as expected, you can use the **Test RLS** feature in the dashboard:\n\n1. **Open the Test Panel** \n On the RLS policies page, click **Test** to open the dedicated testing panel.\n\n2. **Generate an Access Token** \n - Go to the **Weblite page** and use the `POST /v2/tokens` endpoint. \n - Provide a request body with a `userId`, a `name`, and any attributes required by your RLS policies (for example: `role`, `enabled`, etc.). \n - Execute the request and copy the `token` value from the response.\n\n3. **Authenticate in the Test Panel** \n - Paste the generated token into the **Enter Access Token** field and click **Authorize**. \n - The dashboard will now simulate queries to the database as if they were executed by the user identified in the token.\n\n4. **View Filtered Data** \n - Once authenticated, you can navigate through the database tables directly from the test panel. \n - Only the rows allowed by your RLS rules will be displayed (for example, activities tied to the `user_id` in the token or accessible with the `coach` role).\n\n5. **Compare with Full Data** \n - By switching back to **Database Studio**, you can see all rows in the table without RLS filters. \n - This allows you to compare the filtered view (via token) with the complete dataset and confirm that your policies are correctly enforced.\n\n\n\n\n---\n\n## Example\n\nSuppose you have a `tasks` table with the following schema:\n\n```sql\nCREATE TABLE tasks (\n id TEXT PRIMARY KEY NOT NULL,\n user_id TEXT,\n title TEXT,\n status TEXT\n);\n```\n\nHere are a few examples of RLS policies you can create:\n\n**1. Users can only see their own tasks.**\n\n```sql\n-- SELECT policy\nuser_id = auth_userid()\n```\n\n**2. Users can only insert tasks for themselves.**\n\n```sql\n-- INSERT policy\nNEW.user_id = auth_userid()\n```\n\n**3. Users can only update the status of their own tasks.**\n\n```sql\n-- UPDATE policy\nOLD.user_id = auth_userid()\n```\n\n**4. Users can only delete their own tasks.**\n\n```sql\n-- DELETE policy\nOLD.user_id = auth_userid()\n```\n\n**5. Users with the 'admin' group can see all tasks.**\n\n```sql\n-- SELECT policy\njson_extract(auth_json(), '$.attributes.group') = 'admin'\n```\n\n**6. Role-Based Access within a Tenancy**\n\n```sql\n-- SELECT policy\norg_id = json_extract(auth_json(), '$.attributes.org_id') AND\n(json_extract(auth_json(), '$.attributes.role') = 'admin' OR user_id = auth_userid())\n```\n\n**7. Access via a Membership Linking Table**\n\n```sql\n-- SELECT policy\nEXISTS (\n SELECT 1 FROM project_members\n WHERE project_members.project_id = tasks.project_id\n AND project_members.user_id = auth_userid()\n)\n```\n\n**8. Public vs. Private Record Visibility**\n\n```sql\n-- SELECT policy\nvisibility = 'public' OR user_id = auth_userid()\n```\n\nWith these policies, when a user executes a query, SQLite Cloud will automatically enforce the defined RLS rules, ensuring data security and compliance.\n\n### Additional Real-World Examples\n\nHere are a few more examples to illustrate how you can use RLS policies to solve common security challenges.\n\n#### 1. Team-Based Access (Multi-Tenancy)\n\n**Use Case:** A user should only be able to see documents that belong to their organization or team. This is a classic multi-tenancy scenario.\n\n**Assumptions:**\n* Your `documents` table has an `org_id` column.\n* The user's access token contains their organization ID in the JSON attributes (e.g., `{\"org_id\": \"acme_corp\"}`).\n\n**RLS Policy (`SELECT`):**\n```sql\n-- On the 'documents' table\norg_id = json_extract(auth_json(), '$.attributes.org_id')\n```\n\n**Explanation:**\nThis policy ensures that the `org_id` in the document row must match the `org_id` stored in the authenticated user's token. This effectively isolates data between different organizations.\n\n---\n\n#### 2. Content Publishing Workflow\n\n**Use Case:** In a simple CMS or blog, any user (even anonymous ones, if applicable) can see articles with a `published` status. However, only the original author can see their own articles when they are in the `draft` status.\n\n**Assumptions:**\n* Your `articles` table has a `status` column (`'draft'` or `'published'`) and an `author_id` column.\n\n**RLS Policy (`SELECT`):**\n```sql\n-- On the 'articles' table\nstatus = 'published' OR (status = 'draft' AND author_id = auth_userid())\n```\n\n**Explanation:**\nThis policy uses a boolean `OR` to combine two conditions. A user can see a row if:\n1. The article's status is `published`, OR\n2. The article's status is `draft` AND the user is the author.\n\n---\n\n#### 3. Making Records Read-Only\n\n**Use Case:** Once an invoice has been marked as `paid`, it should become immutable. No user should be able to update it.\n\n**Assumptions:**\n* Your `invoices` table has a `status` column (`'pending'`, `'paid'`, etc.).\n\n**RLS Policy (`UPDATE`):**\n```sql\n-- On the 'invoices' table\nOLD.status <> 'paid'\n```\n\n**Explanation:**\nThis policy uses the `OLD` reference to check the value of the `status` column *before* the update is applied. If the status is already `'paid'`, the condition `OLD.status <> 'paid'` will be false, and the `UPDATE` operation will be denied. This effectively makes paid invoices read-only.\n\n\n--- \n\n## Advanced: RLS and SQLite Sync\n\nWhen using RLS in conjunction with SQLite Sync, it's important to understand how they interact. The Sync protocol applies changes on a column-by-column basis, which can affect how `INSERT` and `UPDATE` policies are evaluated.\n\nTo accommodate this, SQLite Cloud offers two modes for handling RLS during sync operations, configurable via the `rls_mode` server setting using the SQLite Cloud builtin command `SET KEY rls_mode TO `.\n\n#### Default Mode (`rls_mode = 1`)\n\nTo simplify policy creation for the most common use cases, the default mode does **not** enforce `INSERT` and `UPDATE` policies while applying changes from SQLite Sync.\n\nInstead, after the sync operation is complete, the `SELECT` policy is used to validate the final state of the row. If the user does not have permission to view the resulting row, the entire transaction is rolled back. This ensures that users cannot introduce changes that they are not allowed to see.\n\n#### Manual Policy Mode (`rls_mode = 0`)\n\nFor more complex scenarios, such as implementing separate read/write permissions or restricting write access to specific columns, you can set `rls_mode` to `0`.\n\nIn this mode, your `INSERT` and `UPDATE` policies are enforced for every incremental change applied by SQLite Sync. Because of Sync's column-by-column operation, your policies must be written to permit intermediate states. This means the policies must allow `NEW` values for non-primary key columns to be temporarily set to their default values during the sync process.","filePath":"docs-website/content/docs/sqlite-cloud/platform/rls.mdx","digest":"62353d1d9e747eae","deferredRender":true,"collection":"docs"}},{"title":"OffSync","filePath":"offsync","type":"inner","level":0,"entry":{"id":"offsync","data":{"title":"OffSync","description":"Enable local-first applications with automatic data synchronization between edge devices and SQLite Cloud.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport enableSync from '@docs-website-assets/introduction/video/dashboard_sqlite_sync_enabling.mp4';\nimport connectionUrlSync from '@docs-website-assets/introduction/video/dashboard_sync_connection_url.mp4';\nimport devicesSync from '@docs-website-assets/introduction/video/dashboard_sync_devices.mp4';\n\nimport Callout from \"@commons-components/Information/Callout.astro\";\n\nOffSync is a powerful SQLite Cloud feature that enables true **local-first** data synchronization for your applications. Powered by the SQLite Sync extension, it allows you to build robust, offline-capable applications where data is stored and processed on edge devices and seamlessly synchronized with a central SQLite Cloud database.\n\nThis architecture is ideal for mobile apps, IoT devices, and any application requiring high availability and low latency, even with intermittent network connectivity. By leveraging Conflict-free Replicated Data Types (CRDTs), OffSync ensures that changes made offline are merged automatically and without conflicts when the device reconnects.\n\n\n---\n\n## How It Works\n\nOffSync extends standard SQLite tables with built-in support for offline work and automatic synchronization. This allows multiple devices to operate independently and then seamlessly merge their changes.\n\n- **Offline-First by Design**: Applications work seamlessly even when devices are offline. Changes are queued locally and synced automatically when connectivity is restored.\n- **CRDT-Based Conflict Resolution**: Merges updates deterministically and efficiently, ensuring eventual consistency across all replicas without complex merge logic.\n- **Seamless Integration**: The sync layer is tightly integrated with SQLite Cloud, enabling secure data sharing across devices, users, and platforms.\n\nWhen combined with [Row-Level Security (RLS)](/docs/rls), OffSync allows you to build secure, multi-tenant applications where each user's data is safely isolated, both on the edge and in the cloud.\n\n\n--- \n\n## Configuring OffSync\n\nYou can enable and manage OffSync for your databases directly from the SQLite Cloud dashboard. \nBelow are the main steps:\n\n### Enable Tables for Synchronization\nFrom the **Sync Tables** tab, select which tables in your database you want to keep synchronized. \nOnce enabled, all changes to those tables will automatically sync with connected devices.\n\n\n\n\n### Get the Connection String\nIn the **Configuration** tab, copy the connection string. \nUse this in your application to initialize OffSync and connect your local SQLite database with SQLite Cloud.\n\n\n\n\n### Manage Connected Devices\nIn the **Devices** tab, you can view all devices currently connected to your database. \nHere you can check their sync status and remove devices if needed.\n\n\n\n\nFor OffSync to work correctly, the list of tables configured for synchronization—and their corresponding schemas—must be identical in both your local SQLite database and your SQLite Cloud database.\n\n\nOnce enabled, any changes made to the selected tables via the SQLite Sync extension will be automatically synchronized with your SQLite Cloud database.","filePath":"docs-website/content/docs/sqlite-cloud/platform/offsync.mdx","digest":"6ae88757e006b993","deferredRender":true,"collection":"docs"}},{"title":"Access Tokens","filePath":"access-tokens","type":"inner","level":0,"entry":{"id":"access-tokens","data":{"title":"Access Tokens","description":"Grant to your users, devices, tenant, access to SQLite Cloud database and services.","customClass":"","category":"platform","status":"publish"},"body":"Access Tokens let backend systems securely grant users, devices, tenants, etc. access to SQLite Cloud database and services (SQLite Sync, Weblite, etc.). These endpoints enable full token lifecycle management: creation, inspection, validation, update, and revocation. All endpoints require authentication. Use an **API Key** or an **Access Token** via the `Authorization` header.\n\nThe API Documentation for the Access Tokens API can be found in the **Weblite** section in the Dashboard.\n\n---\n\n## Example Using SQLite Cloud Access Tokens with Google Login\n\nIn the repository on GitHub sqlitecloud/examples, we created a simple app to demonstrate how to generate and use Access Tokens.\n\nWe’ll log in with Google, grab a token, and use it to interact with SQLite Cloud Weblite APIs. Here’s how it works.\n\nIn the snippet below, we handle the Google Login callback when the user has completed the login on Google. Here, you can exchange the `code` with the Google Access Token and then decide what to do with it as needed.\n\n```typescript\nif (pathname === \"/auth/callback\") {\n const q = query;\n if (q.state !== STATE || !q.code) {\n return send(res, 400, \"Invalid state or missing code\");\n }\n\n try {\n // Exchange code for tokens\n // Store the Google Token in the database\n const googleToken = await getGoogleTokens(q.code as string);\n ...\n```\n\nNow we have authenticated the user, we are ready to request SQLite Cloud to create a new SQLite Cloud Access Token assigned to this user.\n\n```typescript\nasync function getSQLiteCloudToken(userId: string) {\n const payload = {\n name: \"test-user-token\", // A name for the token, can be anything you want\n userId,\n expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(), // expires in 24 hours\n };\n\n const res = await fetch(\"https:///v2/tokens\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${SQLITE_CLOUD_API_KEY}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n });\n if (!res.ok) {\n throw new Error(`Failed to create SQLite Cloud token: ${res.statusText}`);\n }\n\n return res.json();\n}\n```\n\nIn the response JSON, the `data.token` field contains the Access Token.\n\nFinally, the user is authorized to securely access SQLite Cloud services like the Weblite API to perform a query on the database:\n\n```typescript\nconst res = await fetch(\"https:///v2/weblite/sql\", {\n method: \"POST\",\n headers: {\n Authorization: \"Bearer \" + sqliteCloudToken,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n sql: \"USE DATABASE chinook.sqlite;SELECT * FROM artists LIMIT 10;\",\n }),\n});\n...\n```\n\nThe result depends on the [Row Level Security](rls) policies you enabled for the tables.","filePath":"docs-website/content/docs/sqlite-cloud/platform/access-tokens.mdx","digest":"a5f338fcca7fbf10","deferredRender":true,"collection":"docs"}},{"title":"Backups","filePath":"backups","type":"inner","level":0,"entry":{"id":"backups","data":{"title":"Backup","description":"With SQLite Cloud, you have the flexibility to restore your database from any desired point in time.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport enableDisableBackup from '@docs-website-assets/introduction/video/dashboard_enable_disable_backup.mp4';\nimport restoreBackup from '@docs-website-assets/introduction/video/dashboard_restore_backup.mp4';\n\nBackups provide a robust solution for mitigating data loss and resolving data corruption issues. Backups are available for databases in all Dev, Pro and Startup projects.\n\nSQLite Cloud creates a full snapshot backup of your data once a day, and stores incremental changes once per second, on commodity object storage.\n\n---- \n\n## Features\n\n#### Automated Backups\n- **Full Database Snapshots**: Automatically captures a full snapshot of the database at least once every retention period (default 24 hours), ensuring you always have a recent backup.\n- **Incremental Updates**: Captures changes to the database at a frequency of once per second, provided there are modifications.\n- **Continuous Data Protection**: Stores incremental updates alongside full snapshots, allowing for recovery to any specific second within the retention period.\n- **Easy Restoration Process**: Restoring from a backup automatically overwrites the existing database, seamlessly reverting it to the desired state without additional configuration.\n- **Consistency and Reliability**: After restoration, the database functions as it did at the chosen point in time, ensuring operational continuity.\n\n\n---\n\n## Getting Started\nSetting up and managing backups in SQLite Cloud is designed to be straightforward, allowing you to implement robust data protection strategies effortlessly.\n\n\n\n---\n## Restoring from a Backup\n\nClick on a backup to begin the restore process. Select Yes to confirm the restoration, and your database will be restored to the selected point in time.\n\n","filePath":"docs-website/content/docs/sqlite-cloud/platform/backups.mdx","digest":"56817ffd48d2e228","deferredRender":true,"collection":"docs"}},{"title":"Query Analyzer","filePath":"analyzer","type":"inner","level":0,"entry":{"id":"analyzer","data":{"title":"Query Analyzer","description":"The Analyzer panel is a powerful tool that collects and categorizes all the queries executed on your cluster based on their execution time.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport enableAnalyzer from '@docs-website-assets/introduction/video/dashboard_enable_query_analyzer.mp4';\nimport applyAnalyzer from '@docs-website-assets/introduction/video/dashboard_analyzer_apply_suggestion.mp4';\n\nimport Callout from \"@commons-components/Information/Callout.astro\";\n\n\nThe Query Analyzer panel is a powerful tool that collects and categorizes all the queries executed on your cluster based on their execution time. It allows for intelligent and proactive analysis, and provides recommendations on which indexes to use to optimize frequently used queries.\n\n---\n\n## Getting Started\n\nBy default, the Analyzer is disabled to avoid unnecessary overhead. You can enable it directly from the top-left dropdown menu in the Analyzer panel.\n\nSimply click on the dropdown (initially labeled **Disabled**) and select a monitoring threshold. You can choose a preset value (e.g., **Threshold 10ms**, **Threshold 100ms**) or define a **Custom Threshold**. Only queries taking longer than the selected time (in milliseconds) will be recorded and analyzed.\n\n\n\nQuery Analyzer is a **debugging tool**.
    It's recommended to keep it active only for the time strictly necessary to identify and optimize queries.\n
    \n\n\n\n\n\n\n----\n## Testing the Analyzer\nTo test the Analyzer, we can navigate to the `Studio -> chinook.sqlite -> SQL Console` section and perform a query that filters the non-indexed `Composer` column of the `Track` table using the following statement: \n\n`SELECT * FROM Tracks WHERE Composer = 'AC/DC';`\n\n\n\nOnce the query is executed, return to the **Analyzer** panel. You will see the query listed in the table along with execution statistics, such as **Count**, **Avg. Time (ms)**, and **Max Time (ms)**.\n\n### Analyzing Performance and Applying Suggestions\n\nClick on the query row to open the **Query Details** side panel. This panel provides in-depth information organized into three tabs:\n\n1. **Query**: Displays the full SQL statement (with an option to copy it).\n2. **Current Execution Plan**: Shows how the database engine currently processes the query (e.g., `SCAN TABLE` indicates a full table scan, which is often inefficient).\n3. **Index Suggestions**: This is the most critical section for optimization. It displays **Candidate Indexes** and a **Suggested Index**.\n\nTo optimize your database performance, navigate to the **Index Suggestions** tab. \n\nIf an optimization is available, you will see a proposed `CREATE INDEX` statement. \n\nSimply click the **Apply All Suggestions** button. The Analyzer will automatically create and distribute the optimal index in the `chinook.sqlite` database, speeding up future queries filtered by the `Composer` column.","filePath":"docs-website/content/docs/sqlite-cloud/platform/analyzer.mdx","digest":"8ba367523ed0b4a0","deferredRender":true,"collection":"docs"}},{"title":"Logs","filePath":"logs","type":"inner","level":0,"entry":{"id":"logs","data":{"title":"Logs","description":"View detailed insights into your SQLite Cloud project's operations to monitor activity, debug issues, and track system behavior in real time.","customClass":"","category":"platform","status":"publish"},"body":"import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';\nimport logsVideo from '@docs-website-assets/introduction/video/dashboard_logs.mp4';\n\n\nLogs provide detailed insights into your SQLite Cloud project's operations, helping you monitor activity, debug issues, and track system behavior in real time. The Logs panel displays a comprehensive view of all events occurring across your cluster nodes.\n\n\n---\n\n## Key Features\n\n- **Log Monitoring**: View recent log entries with manual refresh capability to get the latest activity\n- **Filtering Options**: Filter logs by time range, specific nodes, and search through messages\n- **Detailed Context**: Each log entry includes timestamp, severity level, source, and detailed message information\n\n\n\n---\n\n## Accessing Logs\n\nNavigate to the **Logs** section from your SQLite Cloud dashboard to view your project's log entries. The interface displays logs in a table format with the following columns:\n\n- **Time**: Timestamp when the event occurred (in UTC)\n- **Level**: Severity level of the log entry \n- **Source**: Component or service that generated the log\n- **Log Type**: Category of the log entry\n- **Message**: Detailed description of the logged event\n\n---\n\n## Filtering Logs\n\n### Timestamp Range\n\nUse the timestamp range selector to filter logs by time period. Available options include:\n\n- Last 30 minutes\n- Last hour\n- Last 12 hours\n- Last day\n- Last 3 days\n- Last week\n- Last 2 weeks\n- Last 30 days\n- Custom date range (using the calendar picker)\n\n### Node Filtering\n\nFilter logs by specific cluster nodes using the **Nodes** section on the left sidebar. You can:\n\n- Search for specific nodes using the search box\n- Select individual nodes to view their logs\n- View the node location (e.g., US East)\n\n### Search Logs\n\nUse the search box at the top of the logs table to filter entries by message content. This helps you quickly locate specific errors or events.\n\n---\n\n## Viewing Log Details\n\nClick on any log entry to view detailed information in the **Log Details** panel. This panel displays:\n\n- **Timestamp**: Exact time of the event\n- **Level**: Severity level\n- **Source**: Originating component\n- **Node ID**: Specific node that generated the log\n- **Log Type**: Category of the event\n- **Message**: Full message with complete error details or event information\n\n---\n\n## Refreshing Logs\n\nClick the **Refresh** button in the top-right corner to manually update the log list and view the most recent entries. This ensures you're viewing the latest activity from your cluster.","filePath":"docs-website/content/docs/sqlite-cloud/platform/logs.mdx","digest":"e8798a4bbc394941","deferredRender":true,"collection":"docs"}},{"title":"Extensions","filePath":"extensions","type":"inner","level":0,"entry":{"id":"extensions","data":{"title":"SQLite Extensions","description":"Extensions available for use in SQLite Cloud.","customClass":"","category":"platform","status":"publish"},"body":"SQLite Cloud comes with the following pre-installed SQLite extensions.\nThese extensions are available for use in your SQLite Cloud databases.\n\n## Extensions\n- **[SQLite-Vector](sqlite-vector)**: High performance vector storage extension for similarity search.\n- **[SQLite-Sync](sqlite-sync)**: Local-first extension for true local-first data synchronization for your applications.\n- **[SQLite-JS](sqlite-js)**: Enables JavaScript integration in SQLite for executing server-side logic.\n- **Full-text Search 5**: Full-text search engine that allows you to search for text in a database.\n- **JSON1**: Allows you to easily store, query, and manipulate JSON data.\n- **Math**: Mathematical functions.\n- **RTree**: R-Tree index for storing and querying spatial data.\n- **Geopoly**: A set of functions for working with geospatial data. For a complete guide, see the [comprehensive tutorial here](tutorial-geopoly).\n\nIn the future, we plan to allow users to install their own extensions. If you have a specific extension you would like to use, please let us know by adding to this issue.","filePath":"docs-website/content/docs/sqlite-cloud/platform/extensions.mdx","digest":"195b4f878adda925","deferredRender":true,"collection":"docs"}},{"title":"Weblite (REST API)","filePath":"weblite","type":"inner","level":0,"entry":{"id":"weblite","data":{"title":"Weblite","description":"With Weblite, adding robust database capabilities to your site is as simple as adding Google Analytics.","customClass":"","category":"platform","status":"publish"},"body":"Weblite consists of an autogenerated HTTP/JSON REST API for programmatically interacting with SQLite Cloud.\n\nIt is the simplest way to add a robust database backend to your application.\n\n## Overview\n\nFirst, navigate to the Weblite panel from the left-hand navigation menu.\n\nFrom here, you'll find a list of APIs you can use to interact with your SQLite Cloud instance, including:\n\n- **Services**: Endpoints for health checks, metrics, and more.\n- **Weblite**: Endpoints for executing SQLiteCloudArrayType, and interacting with databases and tables.\n- **Functions**: Endpoints for executing SQLite functions.\n- **Webhooks**: Endpoints for creating and managing webhooks.\n- **Files**: Endpoints for uploading and downloading files.\n\n## Services\n\nServices are endpoints for health checks, server information, and more.\n\n### Health Check\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/health' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"name\": \"@sqlitecloud/gateway\",\n \"version\": \"x.x.x\",\n \"project\": \"xxxxxxxxxx\",\n \"node\": \"xxxxxxxxxx\",\n \"hostname\": \"xxxxxxxxxx\",\n \"started\": \"YYYY-MM-DDTHH:mm:ss.sssZ\",\n \"uptime\": \"XXh:XXm:XXs\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Info\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/info' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"name\": \"@sqlitecloud/gateway\",\n \"version\": \"x.x.x\",\n \"project\": \"xxxxxxxxxx\",\n \"node\": \"xxxxxxxxxx\",\n \"hostname\": \"xxxxxxxxxx\",\n \"started\": \"YYYY-MM-DDTHH:mm:ss.sssZ\",\n \"uptime\": \"XXh:XXm:XXs\",\n \"drivers\": {\n \"name\": \"@sqlitecloud/drivers\",\n \"version\": \"x.x.x\"\n },\n \"runtime\": {\n \"name\": \"xxxxxxx\",\n \"version\": \"x.x.x\",\n \"path\": \"/path/to/runtime\",\n \"main\": \"/path/to/main/file\"\n },\n \"environment\": {\n \"events\": true,\n \"settings\": true,\n \"stats\": true,\n \"logs\": true\n },\n \"metrics\": {\n \"js_heap_size\": 00000000,\n \"js_heap_capacity\": 00000000,\n \"js_heap_object_count\": 000000,\n \"cpu_user\": 00.0,\n \"cpu_system\": 0.00,\n \"http_requests\": 00000,\n \"http_get\": 00000,\n \"http_completed\": 00000,\n \"http_options\": 00,\n \"ws_requests\": 00,\n \"ws_get\": 00,\n \"ws_completed\": 00,\n \"http_patch\": 0,\n \"http_post\": 0\n },\n \"internetAccess\": true\n },\n \"metadata\": {\n \"connectedMs\": 00,\n \"executedMs\": 00,\n \"elapsedMs\": 00\n }\n}\n```\n\n## Stats\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/stats' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"physicalMemory\": 0000000000,\n \"bytesIn\": 00000,\n \"bytesOut\": 000000,\n \"cpuLoad\": 0.0,\n \"currentClients\": 0,\n \"currentMemory\": 0000000,\n \"maxClients\": 0,\n \"maxMemory\": 0000000,\n \"numCommands\": 000,\n \"numReads\": 00,\n \"numWrites\": 0\n },\n \"metadata\": {\n \"connectedMs\": 00,\n \"executedMs\": 00,\n \"elapsedMs\": 00\n }\n}\n```\n\n## Weblite\n\nWeblite are endpoints for executing SQLiteCloudArrayType, and interacting with databases and tables.\n\n### Run SQL queries on the node - GET\n\nExample request:\n\n```bash\nsql_query=\"SELECT * FROM artists LIMIT 3\"\n\nencoded_query=$(printf '%s' \"$sql_query\" | jq -sRr @uri)\n\ncurl -X 'GET' \\\n \"https://.sqlite.cloud:8090/v2/weblite/sql?sql=$&database=\" \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": [\n { \"ArtistId\": 1, \"Name\": \"AC/DC\" },\n { \"ArtistId\": 2, \"Name\": \"Accept\" },\n { \"ArtistId\": 3, \"Name\": \"Aerosmith\" }\n ],\n \"metadata\": {\n \"connectedMs\": \"X\",\n \"executedMs\": \"XX\",\n \"elapsedMs\": \"XX\",\n \"database\": \"chinook.sqlite\",\n \"sql\": \"SELECT * FROM artists LIMIT 3\",\n \"version\": \"X\",\n \"numberOfRows\": \"X\",\n \"numberOfColumns\": \"X\",\n \"columns\": [\n {\n \"name\": \"ArtistId\",\n \"type\": \"INTEGER\",\n \"database\": \"main\",\n \"table\": \"artists\",\n \"column\": \"ArtistId\",\n \"notNull\": 1,\n \"primaryKey\": 1,\n \"autoIncrement\": 1\n },\n {\n \"name\": \"Name\",\n \"type\": \"NVARCHAR(120)\",\n \"database\": \"main\",\n \"table\": \"artists\",\n \"column\": \"Name\",\n \"notNull\": 0,\n \"primaryKey\": 0,\n \"autoIncrement\": 0\n }\n ]\n }\n}\n```\n\n### Run SQL queries on the node - POST\n\nExample request:\n\n```bash\nsql=\"SELECT * FROM albums LIMIT 5\"\n\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite/sql \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n -d \"{\\\"sql\\\":\\\"$sql\\\", \\\"database\\\": \\\"chinook.sqlite\\\"}\"\n```\n\nExample response:\n\n```json\n{\n \"data\": [\n {\n \"AlbumId\": 1,\n \"Title\": \"For Those About To Rock We Salute You\",\n \"ArtistId\": 1\n },\n { \"AlbumId\": 2, \"Title\": \"Balls to the Wall\", \"ArtistId\": 2 },\n { \"AlbumId\": 3, \"Title\": \"Restless and Wild\", \"ArtistId\": 2 },\n { \"AlbumId\": 4, \"Title\": \"Let There Be Rock\", \"ArtistId\": 1 },\n { \"AlbumId\": 5, \"Title\": \"Big Ones\", \"ArtistId\": 3 }\n ],\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"XX\",\n \"elapsedMs\": \"XX\",\n \"database\": \"chinook.sqlite\",\n \"sql\": \"SELECT * FROM albums LIMIT 5\",\n \"version\": \"X\",\n \"numberOfRows\": \"X\",\n \"numberOfColumns\": \"X\",\n \"columns\": [\n {\n \"name\": \"AlbumId\",\n \"type\": \"INTEGER\",\n \"database\": \"main\",\n \"table\": \"albums\",\n \"column\": \"AlbumId\",\n \"notNull\": 1,\n \"primaryKey\": 1,\n \"autoIncrement\": 1\n },\n {\n \"name\": \"Title\",\n \"type\": \"NVARCHAR(160)\",\n \"database\": \"main\",\n \"table\": \"albums\",\n \"column\": \"Title\",\n \"notNull\": 1,\n \"primaryKey\": 0,\n \"autoIncrement\": 0\n },\n {\n \"name\": \"ArtistId\",\n \"type\": \"INTEGER\",\n \"database\": \"main\",\n \"table\": \"albums\",\n \"column\": \"ArtistId\",\n \"notNull\": 1,\n \"primaryKey\": 0,\n \"autoIncrement\": 0\n }\n ]\n }\n}\n```\n\n### List databases on the node\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/weblite/databases' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": [\n {\n \"type\": \"database\",\n \"name\": \"chinook.sqlite\",\n \"size\": \"XXXXXX\",\n \"connections\": \"X\",\n \"encryption\": null,\n \"backup\": \"X\",\n \"nread\": \"X\",\n \"nwrite\": \"X\",\n \"inbytes\": \"X\",\n \"outbytes\": \"X\",\n \"fragmentation\": \"X.XX\",\n \"pagesize\": \"XXXX\",\n \"encoding\": \"UTF-8\",\n \"status\": \"X\"\n },\n ],\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### List all tables in a database\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/weblite//tables' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": [\n {\n \"type\": \"table\",\n \"name\": \"albums\"\n },\n {\n \"type\": \"table\",\n \"name\": \"artists\"\n }\n ],\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### List all columns in a table\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/weblite///columns' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": [\n {\n \"cid\": 0,\n \"name\": \"AlbumId\",\n \"type\": \"INTEGER\",\n \"notnull\": 1,\n \"dflt_value\": null,\n \"pk\": 1\n },\n {\n \"cid\": 1,\n \"name\": \"Title\",\n \"type\": \"NVARCHAR(160)\",\n \"notnull\": 1,\n \"dflt_value\": null,\n \"pk\": 0\n },\n {\n \"cid\": 2,\n \"name\": \"ArtistId\",\n \"type\": \"INTEGER\",\n \"notnull\": 1,\n \"dflt_value\": null,\n \"pk\": 0\n }\n ],\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Download database from the node\n\nExample request:\n\n```bash\ncurl -X 'GET' -o chinook.sqlite \\\n 'https://.sqlite.cloud:8090/v2/weblite/' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\nA binary file representing the database, eg.chinook.sqlite.\n\n```bash\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 866k 100 866k 0 0 1146k 0 --:--:-- --:--:-- --:--:-- 1145k\n```\n\n### Upload new database to the node\n\nExample request:\n\n```bash\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite/' \\\n -H 'Content-Type: application/octet-stream' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n --data-binary @\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"name\": \"newchinook.sqlite\",\n \"size\": \"XXXXXX\",\n \"connections\": \"X\",\n \"encryption\": null,\n \"backup\": \"X\",\n \"nread\": \"X\",\n \"nwrite\": \"X\",\n \"inbytes\": \"X\",\n \"outbytes\": \"X\",\n \"fragmentation\": \"X.XX\",\n \"pagesize\": \"XXXX\",\n \"encoding\": \"UTF-8\",\n \"status\": \"X\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Replace existing database on the node\n\nExample request:\n\n```bash\ncurl -X 'PATCH' \\\n 'https://.sqlite.cloud:8090/v2/weblite/' \\\n -H 'Content-Type: application/octet-stream' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n --data-binary @\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"name\": \"chinook.sqlite\",\n \"size\": \"XXXXXX\",\n \"connections\": \"X\",\n \"encryption\": null,\n \"backup\": \"X\",\n \"nread\": \"X\",\n \"nwrite\": \"X\",\n \"inbytes\": \"X\",\n \"outbytes\": \"X\",\n \"fragmentation\": \"X.XX\",\n \"pagesize\": \"XXXX\",\n \"encoding\": \"UTF-8\",\n \"status\": \"X\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Delete database from the node\n\nExample request:\n\n```bash\ncurl -X 'DELETE' \\\n 'https://.sqlite.cloud:8090/v2/weblite/' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": \"OK\",\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Select all rows from a table\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/weblite//' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": [\n {\n \"AlbumId\": 1,\n \"Title\": \"For Those About To Rock We Salute You\",\n \"ArtistId\": 1\n },\n {\n \"AlbumId\": 2,\n \"Title\": \"Balls to the Wall\",\n \"ArtistId\": 2\n }\n ],\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Insert one or more rows into a table\n\nExample request:\n\n```bash\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite//' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n -d '[{\"Name\": \"Il Divo\"}, {\"Name\": \"Natalia LaFourcade\"}]'\n```\n\nExample response:\n\n```json\n{\n \"data\": \"OK\",\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Delete all rows in a table (or only those rows specified in search string parameters)\n\nExample request:\n\n```bash\ncurl -X 'DELETE' \\\n 'https://.sqlite.cloud:8090/v2/weblite//' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": \"OK\",\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Select single row by row id\n\nExample request:\n\n```bash\ncurl -X 'GET' \\\n 'https://.sqlite.cloud:8090/v2/weblite///' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"ArtistId\": 10,\n \"Name\": \"Billy Cobham\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Insert specific single row into a table\n\nExample request:\n\n```bash\ncurl -X 'POST' \\\n 'https://.sqlite.cloud:8090/v2/weblite///' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n -d '{\"Name\": \"Alessandro Safina\"}'\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"type\": \"XX\",\n \"index\": \"X\",\n \"lastID\": \"XXX\",\n \"changes\": 1,\n \"totalChanges\": 1,\n \"finalized\": 1,\n \"rowId\": \"X\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Update specific row by row id\n\nExample request:\n\n```bash\ncurl -X 'PATCH' \\\n 'https://.sqlite.cloud:8090/v2/weblite///' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n -d '{\"title\": \"TEST\"}'\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"type\": \"XX\",\n \"index\": \"X\",\n \"lastID\": \"XXX\",\n \"changes\": 1,\n \"totalChanges\": 1,\n \"finalized\": 1,\n \"rowId\": \"X\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```\n\n### Delete specific row in a table\n\nExample request:\n\n```bash\ncurl -X 'DELETE' \\\n 'https://.sqlite.cloud:8090/v2/weblite///' \\\n -H 'accept: application/json' \\\n -H 'Authorization: Bearer sqlitecloud://.sqlite.cloud:8860?apikey='\n```\n\nExample response:\n\n```json\n{\n \"data\": {\n \"type\": \"XX\",\n \"index\": \"X\",\n \"lastID\": \"X\",\n \"changes\": 1,\n \"totalChanges\": 1,\n \"finalized\": 1,\n \"rowId\": \"X\"\n },\n \"metadata\": {\n \"connectedMs\": \"XX\",\n \"executedMs\": \"X\",\n \"elapsedMs\": \"XX\"\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/platform/weblite.mdx","digest":"376b90efb77afe3f","deferredRender":true,"collection":"docs"}},{"title":"Introduction","type":"inner","filePath":"sdk-c-introduction","level":1,"entry":{"id":"sdk-c-introduction","data":{"title":"C","description":"SQCloud C Interface","customClass":"","category":"sdks","status":"publish"},"body":"SQCloud is the C application programmer's interface to SQLite Cloud. SQCloud is a set of library functions that allow client programs to pass queries and SQL commands to the SQLite Cloud backend server and to receive the results of these queries. In addition to the standard SQLite statements, several other [commands](server-side-commands) are supported.\n\nThe following files are required when compiling a C application:\n* sqcloud.c/.h\n* lz4.c/.h\n* libtls.a (for static linking) or libtls.so/.dylib/.dll (for dynamic linking)\n\nThe header file `sqcloud.h` must be included in your C application.\n\nAll the communications between the client and the server are encrypted and so, you are required to link the LibreSSL (libtls) library with your client. More information about LibreSSL and how to compile it can be found in the official LibreSSL website.\n\nThe SQCloud APIs implement the SQLiteCloud Serialization Protocol.","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/getting-started.mdx","digest":"046a6a0425618419","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudConnect","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudconnect","data":{"title":"SQCloudConnect","description":"SQCloud Basic C/C++ Interface SQCloudConnect","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudConnection *SQCloudConnect (const char *hostname, int port, SQCloudConfig *config);\n```\n\n### Description\nInitiate a new connection to a database node specified by hostname and port. This function will always return a non-null object pointer, unless there is too little memory even to allocate the **SQCloudConnection** object.\n\n### Parameters\n* **hostname**: a NULL terminated string that contains host name or host ip address\n* **port**: database server port (you can use the `SQCLOUD_DEFAULT_PORT` macro)\n* **config**: a pointer to a [SQCloudConfig struct](/docs/sqlite-cloud/sdks/c/sqcloudconfig) (cannot be NULL)\n\n### Return value\nA pointer to an opaque **SQCloudConnection** struct.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // do something with the conn object\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudConnect.mdx","digest":"f86085624c25a774","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudConnectWithString","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudconnectwithstring","data":{"title":"SQCloudConnectWithString","description":"SQCloud Basic C/C++ Interface SQCloudConnectWithString","customClass":"","category":"sdks","status":"publish"},"body":"import Callout from \"@commons-components/Information/Callout.astro\"\n\n```c\nSQCloudConnection *SQCloudConnectWithString (const char *s, SQCloudConfig *pconfig);\n```\n\n### Description\nInitiate a new connection to a database node specified by a connection string. This function will always return a non-null object pointer, unless there is too little memory even to allocate the **SQCloudConnection** object.\n\nString `s` must be an URL encoded string with the following format: `sqlitecloud://user:pass@host.com:port/dbname?timeout=10&key2=value2&key3=value3`.\n\n\nAn easy way to obtain a valid connection string is to click on the node address in the [Dashboard Nodes](/docs/scaling) section. A valid connection string will be copied in your clipboard.\n\n\nKey(s) can be:\n* timeout\n* compression\n* sqlite\n* zerotext\n* memory\n* create\n* noblob\n* maxdata\n* maxrows\n* maxrowset\n* root_certificate\n* client_certificate\n* client_certificate_key\n\nThese key(s) are equivalent to the fields specified in the [SQCloudConfig struct](/docs/sqlite-cloud/sdks/c/sqcloudconfig).\n\n### Parameters\n* **s**: an URL encoded NULL terminated string that contains connection info\n* **pconfig**: a pointer to a [SQCloudConfig struct](/docs/sqlite-cloud/sdks/c/sqcloudconfig) (can be NULL) used to override configurations found in the connection string\n\n### Return value\nA pointer to an opaque **SQCloudConnection** struct.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n const char *conninfo = \"sqlitecloud://admin:admin@myproject.sqlite.cloud/invoice.sqlite\";\n\n SQCloudConnection *conn = SQCloudConnectWithString(conninfo, NULL);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // do something with the conn object\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudConnectWithString.mdx","digest":"9c34bd812936b494","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudExec","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudexec","data":{"title":"SQCloudExec","description":"SQCloud Basic C/C++ Interface SQCloudExec","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudResult *SQCloudExec (SQCloudConnection *connection, const char *command);\n```\n\n### Description\nSubmits a command to the server and waits for the result. The command can be any SQLite statement or any built-in [SQLite Cloud command](/docs/commands).\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **command**: a NULL terminated string with the command to execute (multiple commands can be sent if separated by the semicolon character)\n\n### Return value\nA pointer to an opaque **SQCloudResult** struct that must be explicitly deallocated with [SQCloudResultFree](/docs/sqlite-cloud/sdks/c/sqcloudresultfree)\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first (no error check here)\n SQCloudResult *r1 = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // perform an SQL statement (no error check here)\n SQCloudResult *r2 = SQCloudExec(conn, \"SELECT * FROM mytable;\");\n\n // perform multiple SQL statements (no error check here)\n SQCloudResult *r3 = SQCloudExec(conn, \"INSERT INTO mytable (col1) VALUES ('value1'); INSERT INTO mytable (col1) VALUES ('value2'); SELECT * FROM mytable;\");\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudExec.mdx","digest":"400ebd5279ad8344","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudExecArray","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudexecarray","data":{"title":"SQCloudExecArray","description":"SQCloud Basic C/C++ Interface SQCloudExecArray","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudResult *SQCloudExecArray (SQCloudConnection *connection, const char *command, const char **values, uint32_t len[], SQCLOUD_VALUE_TYPE types[], uint32_t n);\n```\n\n### Description\nSubmits a command to the server and waits for the result. The command can be any SQLite statement or any built-in [SQLite Cloud command](/docs/commands). This function is equivalent to the [SQCloudExec](/docs/sqlite-cloud/sdks/c/sqcloudexec) function but special placeholders can be used to bind values to the statement (most of the time avoiding the need to perform copies and to encode data).\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **command**: a NULL terminated string with the command to execute\n* **values**: an array of n values\n* **len**: an array of n length\n* **types**: an array of n types\n* **n** number of array elements\n\n### Return value\nA pointer to an opaque **SQCloudResult** struct that must be explicitly deallocated with [SQCloudResultFree](/docs/sqlite-cloud/sdks/c/sqcloudresultfree)\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first (no error check here)\n SQCloudResult *r1 = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // perform an SQL statement using bindings\n const char *dbname = \"main\";\n const char *tblname = \"mytable\";\n const char *colname = \"mycolumn\";\n int n = 3;\n\n const char *values[3] = {dbname, tblname, colname};\n uint32_t len[3] = {(uint32_t)strlen(dbname), (uint32_t)strlen(tblname), (uint32_t)strlen(colname)};\n SQCLOUD_VALUE_TYPE types[3] = {VALUE_TEXT, VALUE_TEXT, VALUE_TEXT};\n\n const char *command = \"LIST METADATA ? TABLE ? COLUMN ?\";\n SQCloudResult *r2 = SQCloudExecArray(conn, command, values, len, types, n);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudExecArray.mdx","digest":"e50174ff10cdbc7a","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudUUID","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouduuid","data":{"title":"SQCloudUUID","description":"SQCloud Basic C/C++ Interface SQCloudUUID","customClass":"","category":"sdks","status":"publish"},"body":"```c\nconst char *SQCloudUUID (SQCloudConnection *connection);\n```\n\n### Description\nThe **SQCloudUUID** function returns the unique client UUID value.\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\nA NULL terminated string that contains the unique client UUID value.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n const char *UUID = SQCloudUUID(conn);\n printf(\"%s\\n\", UUID);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudUUID.mdx","digest":"1ddbbc249bdba597","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudDisconnect","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouddisconnect","data":{"title":"SQCloudDisconnect","description":"SQCloud Basic C/C++ Interface SQCloudDisconnect","customClass":"","category":"sdks","status":"publish"},"body":"```c\nvoid SQCloudDisconnect (SQCloudConnection *connection);\n```\n\n### Description\nCloses the connection to the server. Also frees memory used by the SQCloudConnection object.\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\nNothing.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // do something with the conn object\n ...\n\n // close connection\n SQCloudDisconnect(conn);\n} \n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudDisconnect.mdx","digest":"d7198cdbe2c5f5be","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudConfig","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudconfig","data":{"title":"SQCloudConfig","description":"SQCloud Basic C/C++ Interface SQCloudConfig","customClass":"","category":"sdks","status":"publish"},"body":"### Description\nThe **SQCloudConfig** struct is used in the [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) and in the [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring) functions to set connection specific configuration parameters.\n\n\n### SQCloudConfig\n```c\ntypedef struct SQCloudConfigStruct {\n const char *username; // connection username\n const char *password; // connection password\n const char *database; // database to use during connection\n int timeout; // connection timeout parameter\n int family; // can be: SQCLOUD_IPv4, SQCLOUD_IPv6 or SQCLOUD_IPANY\n bool compression; // compression flag\n bool sqlite_mode; // special sqlite compatibility mode\n bool zero_text; // flag to tell the server to zero-terminate strings\n bool password_hashed; // private flag\n bool nonlinearizable; // flag to request for immediate responses from the server node without waiting for linerizability guarantees\n bool db_memory; // flag to force the database to be in-memory\n bool no_blob; // flag to tell the server to not send BLOB columns\n bool db_create; // flag to force the creation of the database (if it does not exist)\n int max_data; // value to tell the server to not send columns with more than max_data bytes\n int max_rows; // value to control rowset chunks based on the number of rows\n int max_rowset; // value to control the maximum allowed size for a rowset\n #ifndef SQLITECLOUD_DISABLE_TSL\n const char *tls_root_certificate;\n const char *tls_certificate;\n const char *tls_certificate_key;\n bool insecure; // flag to disable TLS\n #endif\n config_cb callback; // reserved callback for internal usage\n void *data; // reserved callback data parameter\n} SQCloudConfig;\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudConfig.mdx","digest":"ee30719114cdcf62","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultIsOK","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultisok","data":{"title":"SQCloudResultIsOK","description":"SQCloud Basic C/C++ Interface SQCloudResultIsOK","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudResultIsOK (SQCloudResult *result);\n```\n\n### Description\nCheck if the opaque datatype result is an OK message.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\n`true` if result is OK, otherwise `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n if (SQCloudResultIsOK(r)) {\n printf(\"USE DATABASE succesfully executed.\\n\");\n } else {\n printf(\"An error occurred while processing the USE DATABASE command.\\n\");\n }\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultIsOK.mdx","digest":"42f82004e89798c7","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultIsError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultiserror","data":{"title":"SQCloudResultIsError","description":"SQCloud Basic C/C++ Interface SQCloudResultIsError","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudResultIsError (SQCloudResult *result);\n```\n\n### Description\nCheck if the opaque datatype result is an error.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\n`true` if result is error, otherwise `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n if (SQCloudResultIsError(r)) {\n printf(\"An error occurred while processing the USE DATABASE command.\\n\");\n } else {\n printf(\"USE DATABASE succesfully executed.\\n\");\n }\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultIsError.mdx","digest":"330a9359f1017897","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultType","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresulttype","data":{"title":"SQCloudResultType","description":"SQCloud Basic C/C++ Interface SQCloudResultType","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCLOUD_RESULT_TYPE SQCloudResultType (SQCloudResult *result);\n```\n\n### Description\nGet the type of the opaque datatype result.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nAn `int` represented by the SQCLOUD_RESULT_TYPE enum type:\n```c\ntypedef enum {\n RESULT_OK,\n RESULT_ERROR,\n RESULT_STRING,\n RESULT_INTEGER,\n RESULT_FLOAT,\n RESULT_ROWSET,\n RESULT_ARRAY,\n RESULT_NULL,\n RESULT_JSON,\n RESULT_BLOB\n} SQCLOUD_RESULT_TYPE;\n```\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n SQCLOUD_RESULT_TYPE type = SQCloudResultType(r);\n switch(type) {\n case RESULT_OK: printf(\"Result is OK\\n\"); break;\n case RESULT_ERROR: printf(\"Result is ERROR\\n\"); break;\n case RESULT_STRING: printf(\"Result is STRING\\n\"); break;\n case RESULT_INTEGER: printf(\"Result is INTEGER\\n\"); break;\n case RESULT_FLOAT: printf(\"Result is FLOAT\\n\"); break;\n case RESULT_ROWSET: printf(\"Result is ROWSET\\n\"); break;\n case RESULT_ARRAY: printf(\"Result is ARRAY\\n\"); break;\n case RESULT_NULL: printf(\"Result is NULL\\n\"); break;\n case RESULT_JSON: printf(\"Result is JSON\\n\"); break;\n case RESULT_BLOB: printf(\"Result is BLOB\\n\"); break;\n }\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultType.mdx","digest":"7bb7cc74345273fa","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultLen","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultlen","data":{"title":"SQCloudResultLen","description":"SQCloud Basic C/C++ Interface SQCloudResultLen","customClass":"","category":"sdks","status":"publish"},"body":"```c\nuint32_t SQCloudResultLen (SQCloudResult *result)\n```\n\n### Description\nReturn the length of the raw buffer contained in the result opaque datatype.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nAn `uint32_t` length value.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first (no error check)\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // perform a query (no error check)\n SQCloudResult *r2 = SQCloudExec(conn, \"SELECT * FROM table1;\");\n\n int32_t len = SQCloudResultLen(r2);\n printf(\"Query size: %d\\n\", len);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultLen.mdx","digest":"94605c89cf311a51","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultInt32","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultint32","data":{"title":"SQCloudResultInt32","description":"SQCloud Basic C/C++ Interface SQCloudResultInt32","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint32_t SQCloudResultInt32 (SQCloudResult *result);\n```\n\n### Description\nIf the result of the function [SQCloudResultType](/docs/sqlite-cloud/sdks/c/sqcloudresulttype) is RESULT_INTEGER then use this function to retrieve an Int32 value.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nAn `int32_t` value.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // execute a sample command\n SQCloudResult *r = SQCloudExec(conn, \"GET INFO process_id;\");\n int32_t value = SQCloudResultInt32(r);\n SQCloudResultFree(r);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultInt32.mdx","digest":"94d5f9af81a22521","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultInt64","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultint64","data":{"title":"SQCloudResultInt64","description":"SQCloud Basic C/C++ Interface SQCloudResultInt64","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint64_t SQCloudResultInt64 (SQCloudResult *result);\n```\n\n### Description\nIf the result of the function [SQCloudResultType](/docs/sqlite-cloud/sdks/c/sqcloudresulttype) is RESULT_INTEGER then use this function to retrieve an Int64 value.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nAn `int64_t` value.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // execute a sample command\n SQCloudResult *r = SQCloudExec(conn, \"GET INFO process_id;\");\n int64_t value = SQCloudResultInt64(r);\n SQCloudResultFree(r);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultInt64.mdx","digest":"ad43eaaf69bca759","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultFloat","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultfloat","data":{"title":"SQCloudResultFloat","description":"SQCloud Basic C/C++ Interface SQCloudResultFloat","customClass":"","category":"sdks","status":"publish"},"body":"```c\nfloat SQCloudResultFloat (SQCloudResult *result);\n```\n\n### Description\nIf the result of the function [SQCloudResultType](/docs/sqlite-cloud/sdks/c/sqcloudresulttype) is RESULT_FLOAT then use this function to retrieve a Float value.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nAn `float` value.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // execute a sample command\n SQCloudResult *r = SQCloudExec(conn, \"GET INFO disk_usage_perc;\");\n float value = SQCloudResultFloat(r);\n SQCloudResultFree(r);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultFloat.mdx","digest":"9333ab5733795141","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultDouble","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultdouble","data":{"title":"SQCloudResultDouble","description":"SQCloud Basic C/C++ Interface SQCloudResultDouble","customClass":"","category":"sdks","status":"publish"},"body":"```c\ndouble SQCloudResultDouble (SQCloudResult *result);\n```\n\n### Description\nIf the result of the function [SQCloudResultType](/docs/sqlite-cloud/sdks/c/sqcloudresulttype) is RESULT_FLOAT then use this function to retrieve a Double value.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nA `double` value.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // execute a sample command\n SQCloudResult *r = SQCloudExec(conn, \"GET INFO disk_usage_perc;\");\n double value = SQCloudResultDouble(r);\n SQCloudResultFree(r);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultDouble.mdx","digest":"a70eeda784f1a532","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultFree","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultfree","data":{"title":"SQCloudResultFree","description":"SQCloud Basic C/C++ Interface SQCloudResultFree","customClass":"","category":"sdks","status":"publish"},"body":"```c\nvoid SQCloudResultFree (SQCloudResult *result);\n```\n\n### Description\nFrees the storage associated with a SQCloudResult. Every command result should be freed via SQCloudResultFree when it is no longer needed.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nNone.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first (no error check)\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n SQCloudResultFree(r);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultFree.mdx","digest":"5ebae3ef6ad33020","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudResultDump","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudresultdump","data":{"title":"SQCloudResultDump","description":"SQCloud Basic C/C++ Interface SQCloudResultDump","customClass":"","category":"sdks","status":"publish"},"body":"```c\nvoid SQCloudResultDump (SQCloudConnection *connection, SQCloudResult *result);\n```\n\n### Description\nPrint the result on standard output.\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n\n### Return value\nNone.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first (no error check here)\n SQCloudResult *r1 = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // perform an SQL statement (no error check here)\n SQCloudResult *r2 = SQCloudExec(conn, \"SELECT * FROM mytable;\");\n\n SQCloudResultDump(conn, r2);\n\n // ...\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudResultDump.mdx","digest":"565964c6f9bc9a93","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudRowsetValueType","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudrowsetvaluetype","data":{"title":"SQCloudRowsetValueType","description":"SQCloud Rowset C/C++ Interface SQCloudRowsetValueType","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCLOUD_VALUE_TYPE SQCloudRowsetValueType (SQCloudResult *result, uint32_t row, uint32_t col);\n```\n\n### Description\nIf the result of the function [SQCloudResultType](/docs/sqlite-cloud/sdks/c/sqcloudresulttype) is RESULT_ROWSET then use this function to retrieve the type of each rowset item identified by a given row and column index.\n\n### Parameters\n* **result**: A valid SQCloudResult pointer returned by an SQCloud function.\n* **row**: A row index (from 0 to [SQCloudRowsetRows](/docs/sqlite-cloud/sdks/c/sqcloudrowsetrows)-1)\n* **col**: A column index (from 0 to [SQCloudRowsetCols](/docs/sqlite-cloud/sdks/c/sqcloudrowsetcols)-1)\n\n### Return value\nAn `int` represented by the SQCLOUD_VALUE_TYPE enum type:\n```c\ntypedef enum {\n VALUE_INTEGER = 1,\n VALUE_FLOAT = 2,\n VALUE_TEXT = 3,\n VALUE_BLOB = 4,\n VALUE_NULL = 5\n} SQCLOUD_VALUE_TYPE;\n```\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first (no error check here)\n SQCloudResult *r1 = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n SQCloudResultFree(r1);\n\n // perform a sample query\n SQCloudResult *r = SQCloudExec(conn, \"SELECT * FROM mytable;\");\n if (SQCloudResultType(r) == RESULT_ROWSET) {\n uint32_t nrows = SQCloudRowsetRows(r);\n uint32_t ncols = SQCloudRowsetCols(r);\n\n // print column names\n for (uint32_t i=0; isqlite3_error_* SQLite APIs. \n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\n* **SQLiteIsError** returns `true` if the most recent API call failed.\n* **SQCloudIsSQLiteError** returns `true` if the most recent error is related to an SQLite operation.\n* **SQCloudErrorCode** returns the numeric error code (or 0 if no error).\n* **SQCloudExtendedErrorCode** returns the numeric extended error code related to the failed SQLite operation.\n* **SQCloudErrorOffset** returns the byte offset of the start of the most recent error references a specific token in the input SQL (if any). If the most recent error does not reference a specific token in the input SQL, then the **SQCloudErrorOffset** function returns -1.\n* **SQCloudErrorMsg** return English-language text that describes the error.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // check errors\n if (SQCloudIsError(conn)) {\n int errcode = SQCloudErrorCode(conn);\n const char *errmsg = SQCloudErrorMsg(conn);\n printf(\"Err code: %d - Err msg: %s\\n\", errcode, errmsg);\n\n if (SQCloudIsSQLiteError(conn)) {\n int exterr = SQCloudExtendedErrorCode(conn);\n int offerr = SQCloudErrorOffset(conn);\n printf(\"Ext code: %d - Err offset: %d\\n\", exterr, offerr);\n }\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudError.mdx","digest":"1c6428a84971fed6","deferredRender":true,"collection":"docs"}},{"title":"SQCloudIsSQLiteError","filePath":"sqlite-cloud/sdks/c/SQCloudError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouderror","data":{"title":"Error APIs","description":"SQCloud Error API C/C++ Interface","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudIsError (SQCloudConnection *connection);\nbool SQCloudIsSQLiteError (SQCloudConnection *connection);\nint SQCloudErrorCode (SQCloudConnection *connection);\nint SQCloudExtendedErrorCode (SQCloudConnection *connection);\nint SQCloudErrorOffset (SQCloudConnection *connection);\nconst char *SQCloudErrorMsg (SQCloudConnection *connection);\n```\n\n### Description\nIf the most recent API call associated with with database connection failed, then this APIs return information about the error.\nThese functions resemble the sqlite3_error_* SQLite APIs. \n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\n* **SQLiteIsError** returns `true` if the most recent API call failed.\n* **SQCloudIsSQLiteError** returns `true` if the most recent error is related to an SQLite operation.\n* **SQCloudErrorCode** returns the numeric error code (or 0 if no error).\n* **SQCloudExtendedErrorCode** returns the numeric extended error code related to the failed SQLite operation.\n* **SQCloudErrorOffset** returns the byte offset of the start of the most recent error references a specific token in the input SQL (if any). If the most recent error does not reference a specific token in the input SQL, then the **SQCloudErrorOffset** function returns -1.\n* **SQCloudErrorMsg** return English-language text that describes the error.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // check errors\n if (SQCloudIsError(conn)) {\n int errcode = SQCloudErrorCode(conn);\n const char *errmsg = SQCloudErrorMsg(conn);\n printf(\"Err code: %d - Err msg: %s\\n\", errcode, errmsg);\n\n if (SQCloudIsSQLiteError(conn)) {\n int exterr = SQCloudExtendedErrorCode(conn);\n int offerr = SQCloudErrorOffset(conn);\n printf(\"Ext code: %d - Err offset: %d\\n\", exterr, offerr);\n }\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudError.mdx","digest":"1c6428a84971fed6","deferredRender":true,"collection":"docs"}},{"title":"SQCloudErrorCode","filePath":"sqlite-cloud/sdks/c/SQCloudError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouderror","data":{"title":"Error APIs","description":"SQCloud Error API C/C++ Interface","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudIsError (SQCloudConnection *connection);\nbool SQCloudIsSQLiteError (SQCloudConnection *connection);\nint SQCloudErrorCode (SQCloudConnection *connection);\nint SQCloudExtendedErrorCode (SQCloudConnection *connection);\nint SQCloudErrorOffset (SQCloudConnection *connection);\nconst char *SQCloudErrorMsg (SQCloudConnection *connection);\n```\n\n### Description\nIf the most recent API call associated with with database connection failed, then this APIs return information about the error.\nThese functions resemble the sqlite3_error_* SQLite APIs. \n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\n* **SQLiteIsError** returns `true` if the most recent API call failed.\n* **SQCloudIsSQLiteError** returns `true` if the most recent error is related to an SQLite operation.\n* **SQCloudErrorCode** returns the numeric error code (or 0 if no error).\n* **SQCloudExtendedErrorCode** returns the numeric extended error code related to the failed SQLite operation.\n* **SQCloudErrorOffset** returns the byte offset of the start of the most recent error references a specific token in the input SQL (if any). If the most recent error does not reference a specific token in the input SQL, then the **SQCloudErrorOffset** function returns -1.\n* **SQCloudErrorMsg** return English-language text that describes the error.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // check errors\n if (SQCloudIsError(conn)) {\n int errcode = SQCloudErrorCode(conn);\n const char *errmsg = SQCloudErrorMsg(conn);\n printf(\"Err code: %d - Err msg: %s\\n\", errcode, errmsg);\n\n if (SQCloudIsSQLiteError(conn)) {\n int exterr = SQCloudExtendedErrorCode(conn);\n int offerr = SQCloudErrorOffset(conn);\n printf(\"Ext code: %d - Err offset: %d\\n\", exterr, offerr);\n }\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudError.mdx","digest":"1c6428a84971fed6","deferredRender":true,"collection":"docs"}},{"title":"SQCloudExtendedErrorCode","filePath":"sqlite-cloud/sdks/c/SQCloudError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouderror","data":{"title":"Error APIs","description":"SQCloud Error API C/C++ Interface","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudIsError (SQCloudConnection *connection);\nbool SQCloudIsSQLiteError (SQCloudConnection *connection);\nint SQCloudErrorCode (SQCloudConnection *connection);\nint SQCloudExtendedErrorCode (SQCloudConnection *connection);\nint SQCloudErrorOffset (SQCloudConnection *connection);\nconst char *SQCloudErrorMsg (SQCloudConnection *connection);\n```\n\n### Description\nIf the most recent API call associated with with database connection failed, then this APIs return information about the error.\nThese functions resemble the sqlite3_error_* SQLite APIs. \n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\n* **SQLiteIsError** returns `true` if the most recent API call failed.\n* **SQCloudIsSQLiteError** returns `true` if the most recent error is related to an SQLite operation.\n* **SQCloudErrorCode** returns the numeric error code (or 0 if no error).\n* **SQCloudExtendedErrorCode** returns the numeric extended error code related to the failed SQLite operation.\n* **SQCloudErrorOffset** returns the byte offset of the start of the most recent error references a specific token in the input SQL (if any). If the most recent error does not reference a specific token in the input SQL, then the **SQCloudErrorOffset** function returns -1.\n* **SQCloudErrorMsg** return English-language text that describes the error.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // check errors\n if (SQCloudIsError(conn)) {\n int errcode = SQCloudErrorCode(conn);\n const char *errmsg = SQCloudErrorMsg(conn);\n printf(\"Err code: %d - Err msg: %s\\n\", errcode, errmsg);\n\n if (SQCloudIsSQLiteError(conn)) {\n int exterr = SQCloudExtendedErrorCode(conn);\n int offerr = SQCloudErrorOffset(conn);\n printf(\"Ext code: %d - Err offset: %d\\n\", exterr, offerr);\n }\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudError.mdx","digest":"1c6428a84971fed6","deferredRender":true,"collection":"docs"}},{"title":"SQCloudErrorOffset","filePath":"sqlite-cloud/sdks/c/SQCloudError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouderror","data":{"title":"Error APIs","description":"SQCloud Error API C/C++ Interface","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudIsError (SQCloudConnection *connection);\nbool SQCloudIsSQLiteError (SQCloudConnection *connection);\nint SQCloudErrorCode (SQCloudConnection *connection);\nint SQCloudExtendedErrorCode (SQCloudConnection *connection);\nint SQCloudErrorOffset (SQCloudConnection *connection);\nconst char *SQCloudErrorMsg (SQCloudConnection *connection);\n```\n\n### Description\nIf the most recent API call associated with with database connection failed, then this APIs return information about the error.\nThese functions resemble the sqlite3_error_* SQLite APIs. \n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\n* **SQLiteIsError** returns `true` if the most recent API call failed.\n* **SQCloudIsSQLiteError** returns `true` if the most recent error is related to an SQLite operation.\n* **SQCloudErrorCode** returns the numeric error code (or 0 if no error).\n* **SQCloudExtendedErrorCode** returns the numeric extended error code related to the failed SQLite operation.\n* **SQCloudErrorOffset** returns the byte offset of the start of the most recent error references a specific token in the input SQL (if any). If the most recent error does not reference a specific token in the input SQL, then the **SQCloudErrorOffset** function returns -1.\n* **SQCloudErrorMsg** return English-language text that describes the error.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // check errors\n if (SQCloudIsError(conn)) {\n int errcode = SQCloudErrorCode(conn);\n const char *errmsg = SQCloudErrorMsg(conn);\n printf(\"Err code: %d - Err msg: %s\\n\", errcode, errmsg);\n\n if (SQCloudIsSQLiteError(conn)) {\n int exterr = SQCloudExtendedErrorCode(conn);\n int offerr = SQCloudErrorOffset(conn);\n printf(\"Ext code: %d - Err offset: %d\\n\", exterr, offerr);\n }\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudError.mdx","digest":"1c6428a84971fed6","deferredRender":true,"collection":"docs"}},{"title":"SQCloudErrorMsg","filePath":"sqlite-cloud/sdks/c/SQCloudError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouderror","data":{"title":"Error APIs","description":"SQCloud Error API C/C++ Interface","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudIsError (SQCloudConnection *connection);\nbool SQCloudIsSQLiteError (SQCloudConnection *connection);\nint SQCloudErrorCode (SQCloudConnection *connection);\nint SQCloudExtendedErrorCode (SQCloudConnection *connection);\nint SQCloudErrorOffset (SQCloudConnection *connection);\nconst char *SQCloudErrorMsg (SQCloudConnection *connection);\n```\n\n### Description\nIf the most recent API call associated with with database connection failed, then this APIs return information about the error.\nThese functions resemble the sqlite3_error_* SQLite APIs. \n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\n* **SQLiteIsError** returns `true` if the most recent API call failed.\n* **SQCloudIsSQLiteError** returns `true` if the most recent error is related to an SQLite operation.\n* **SQCloudErrorCode** returns the numeric error code (or 0 if no error).\n* **SQCloudExtendedErrorCode** returns the numeric extended error code related to the failed SQLite operation.\n* **SQCloudErrorOffset** returns the byte offset of the start of the most recent error references a specific token in the input SQL (if any). If the most recent error does not reference a specific token in the input SQL, then the **SQCloudErrorOffset** function returns -1.\n* **SQCloudErrorMsg** return English-language text that describes the error.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // check errors\n if (SQCloudIsError(conn)) {\n int errcode = SQCloudErrorCode(conn);\n const char *errmsg = SQCloudErrorMsg(conn);\n printf(\"Err code: %d - Err msg: %s\\n\", errcode, errmsg);\n\n if (SQCloudIsSQLiteError(conn)) {\n int exterr = SQCloudExtendedErrorCode(conn);\n int offerr = SQCloudErrorOffset(conn);\n printf(\"Ext code: %d - Err offset: %d\\n\", exterr, offerr);\n }\n }\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudError.mdx","digest":"1c6428a84971fed6","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMCompile","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmcompile","data":{"title":"SQCloudVMCompile","description":"SQCloud VM C/C++ Interface SQCloudVMCompile","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudVM *SQCloudVMCompile (SQCloudConnection *connection, const char *sql, int32_t len, const char **tail);\n```\n\n### Description\nCompile an SQL statement into a byte-code virtual machine.\nThis function resembles the sqlite3_prepare SQLite API. \n\n### Parameters\n* **connection**: A valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **sql**: The statement to be compiled. \n* **len**: If the len argument is negative, then sql is read up to the first zero terminator. If len is positive, then it is the number of bytes read from sql.\n* **tail**: If the tail argument is not NULL then *tail is made to point to the first byte past the end of the first SQL statement in sql. SQCloudVMCompile compiles only the first statement in sql, so *tail is left pointing to what remains uncompiled.\n\n\n### Return value\nAn `SQCloudVM` opaque datatype representing the compiled statement.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES (?1);\", -1, NULL);\n\n // do something with vm\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMCompile.mdx","digest":"a78f004f9ac35cff","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMStep","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmstep","data":{"title":"SQCloudVMStep","description":"SQCloud VM C/C++ Interface SQCloudVMStep","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCLOUD_RESULT_TYPE SQCloudVMStep (SQCloudVM *vm);\n```\n\n### Description\nEvaluate an SQL statement previously compiled by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\nThis function resembles the sqlite3_step SQLite API. \n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nAn `int` represented by the SQCLOUD_RESULT_TYPE enum type:\n```c\ntypedef enum {\n RESULT_OK,\n RESULT_ERROR,\n RESULT_STRING,\n RESULT_INTEGER,\n RESULT_FLOAT,\n RESULT_ROWSET,\n RESULT_ARRAY,\n RESULT_NULL,\n RESULT_JSON,\n RESULT_BLOB\n} SQCLOUD_RESULT_TYPE;\n```\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMStep.mdx","digest":"2cc91dc2b373390d","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMResult","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmresult","data":{"title":"SQCloudVMResult","description":"SQCloud VM C/C++ Interface SQCloudVMResult","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudResult *SQCloudVMResult (SQCloudVM *vm);\n```\n\n### Description\nRetrieve the raw SQCloudResult associated with the VM. You can then use the SQCloudResult API to further process the SQCloudResult.\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nAn SQCloudResult opaque datatype.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCloudResult *type = SQCloudVMStep(vm);\n\n // retrieve result\n SQCloudResult *result = SQCloudVMResult(vm);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMResult.mdx","digest":"c865e6a78e86c8fd","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMClose","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmclose","data":{"title":"SQCloudVMClose","description":"SQCloud VM C/C++ Interface SQCloudVMClose","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMClose (SQCloudVM *vm);\n```\n\n### Description\nFrees the storage associated with a SQCloudVM. The application must finalize every compiled statement in order to avoid resource leaks.\nThis function resembles the sqlite3_finalize SQLite API. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nIf the VM is successfully freed without any errors, the function will return `true`. If an error occurs during the freeing process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCloudResult *type = SQCloudVMStep(vm);\n\n // ...\n\n // free resources associated with the VM\n bool rc = SQCloudVMClose(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMClose.mdx","digest":"902147a56294bef7","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMErrorMsg","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmerrormsg","data":{"title":"SQCloudVMErrorMsg","description":"SQCloud VM C/C++ Interface SQCloudVMErrorMsg","customClass":"","category":"sdks","status":"publish"},"body":"```c\nconst char *SQCloudVMErrorMsg (SQCloudVM *vm);\n```\n\n### Description\nRetrieve the latest error message (if any) from the associated vm.\n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nA null-terminated error message, or NULL if no errors are found.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // get error message\n const char *msg = SQCloudVMErrorMsg(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMErrorMsg.mdx","digest":"ac0a341ffec6b6fd","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMErrorCode","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmerrorcode","data":{"title":"SQCloudVMErrorCode","description":"SQCloud VM C/C++ Interface SQCloudVMErrorCode","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudVMErrorCode (SQCloudVM *vm);\n```\n\n### Description\nRetrieve the latest error code (if any) from the associated vm.\n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nAn error code or 0 if no error is found.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // get error code\n int err = SQCloudVMErrorCode(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMErrorCode.mdx","digest":"f2adeefe0b572254","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMIsReadOnly","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmisreadonly","data":{"title":"SQCloudVMIsReadOnly","description":"SQCloud VM C/C++ Interface SQCloudVMIsReadOnly","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMIsReadOnly (SQCloudVM *vm);\n```\n\n### Description\nThe **SQCloudVMIsReadOnly** interface returns true if and only if the prepared statement bound to vm makes no direct changes to the content of the database file. This routine returns false if there is any possibility that the statement might change the database file. A false return does not guarantee that the statement will change the database file. This function resembles the sqlite3_stmt_readonly SQLite API.\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nA `bool` value that indicates if the vm is readonly.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCloudResult *type = SQCloudVMStep(vm);\n\n // check if vm is readonly\n bool rc = SQCloudVMIsReadOnly(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMIsReadOnly.mdx","digest":"936effaf858eb936","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMIsExplain","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmisexplain","data":{"title":"SQCloudVMIsExplain","description":"SQCloud VM C/C++ Interface SQCloudVMIsExplain","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudVMIsExplain (SQCloudVM *vm);\n```\n\n### Description\nThe **SQCloudVMIsExplain** interface returns 1 if the prepared statement S is an EXPLAIN statement, or 2 if the statement S is an EXPLAIN QUERY PLAN. **SQCloudVMIsExplain** interface returns 0 if the statement is an ordinary statement or a NULL pointer. This function resembles the sqlite3_stmt_isexplain SQLite API.\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n### Return value\nAn `int` value representing if the original statement was an EXPLAIN.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCloudResult *type = SQCloudVMStep(vm);\n\n // check if vm is explain\n int rc = SQCloudVMIsExplain(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMIsExplain.mdx","digest":"c499927311a2b669","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMIsFinalized","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmisfinalized","data":{"title":"SQCloudVMIsFinalized","description":"SQCloud VM C/C++ Interface SQCloudVMIsFinalized","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMIsFinalized (SQCloudVM *vm);\n```\n\n### Description\nThe **SQCloudVMIsFinalized** interface returns true if the prepared statement bound to the vm has been stepped at least once using [SQCloudVMStep](/docs/sqlite-cloud/sdks/c/sqcloudvmstep) but has neither run to completion nor been reset. This function resembles the sqlite3_stmt_busy SQLite API.\n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nA `bool` value that indicates if the vm is finalized.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCloudResult *type = SQCloudVMStep(vm);\n\n // check if vm is finalized\n bool rc = SQCloudVMIsFinalized(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMIsFinalized.mdx","digest":"df9aafeea923fdfe","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMBindParameterCount","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbindparametercount","data":{"title":"SQCloudVMBindParameterCount","description":"SQCloud VM C/C++ Interface SQCloudVMBindParameterCount","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudVMBindParameterCount (SQCloudVM *vm);\n```\n\n### Description\nThis routine can be used to find the number of SQL parameters in a prepared statement. SQL parameters are tokens of the form \"?\", \"?NNN\", \":AAA\", \"$AAA\", or \"@AAA\" that serve as placeholders for values that are bound to the parameters at a later time. This routine actually returns the index of the largest (rightmost) parameter. For all forms except ?NNN, this will correspond to the number of unique parameters. If parameters of the ?NNN form are used, there may be gaps in the list.\n\nThis function resembles the bind_parameter_count SQLite API. \n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nAn `int` representing the number of SQL parameters in a prepared statement.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('?1');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // count parameters\n int counter = SQCloudVMBindParameterCount(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBindParameterCount.mdx","digest":"44e95363abe375ae","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMBindParameterIndex","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbindparameterindex","data":{"title":"SQCloudVMBindParameterIndex","description":"SQCloud VM C/C++ Interface SQCloudVMBindParameterIndex","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudVMBindParameterIndex (SQCloudVM *vm, const char *name);\n```\n\n### Description\nReturn the index of an SQL parameter given its name. The index value returned is suitable for use as the second parameter to [SQCloudVMBind](/docs/sqlite-cloud/sdks/c/sqcloudvmbind). A zero is returned if no matching parameter is found.\n\nThis function resembles the bind_parameter_index SQLite API. \n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **name**: The SQL parameter name.\n\n### Return value\nAn `int` representing the index of the name parameter.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('?param1');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // get the parameter index\n int index = SQCloudVMBindParameterIndex(vm, \"param1\");\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBindParameterIndex.mdx","digest":"9044a4a60a68de84","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMBindParameterName","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbindparametername","data":{"title":"SQCloudVMBindParameterName","description":"SQCloud VM C/C++ Interface SQCloudVMBindParameterName","customClass":"","category":"sdks","status":"publish"},"body":"```c\nconst char *SQCloudVMBindParameterName (SQCloudVM *vm, int index);\n```\n\n### Description\nThe **SQCloudVMBindParameterName** interface returns the name of the N-th SQL parameter in the prepared statement **vm**. SQL parameters of the form \"?NNN\" or \":AAA\" or \"@AAA\" or \"$AAA\" have a name which is the string \"?NNN\" or \":AAA\" or \"@AAA\" or \"$AAA\" respectively. In other words, the initial \":\" or \"$\" or \"@\" or \"?\" is included as part of the name. Parameters of the form \"?\" without a following integer have no name and are referred to as \"nameless\" or \"anonymous parameters\".\n\nThe first host parameter has an index of 1, not 0.\nIf the value of index is out of range or if the N-th parameter is nameless, then NULL is returned.\n\nThis function resembles the bind_parameter_name SQLite API. \n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The SQL parameter index.\n\n### Return value\nA `const char *` NULL-terminated string representing the name of the parameter.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('?param1');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // get the parameter name\n const char *name = SQCloudVMBindParameterName(vm, 1);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBindParameterName.mdx","digest":"c5b9bf2da8dfad08","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMColumnCount","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmcolumncount","data":{"title":"SQCloudVMColumnCount","description":"SQCloud VM C/C++ Interface SQCloudVMColumnCount","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudVMColumnCount (SQCloudVM *vm);\n```\n\n### Description\nThe **SQCloudVMColumnCount** returns the number of columns in the result set returned by the prepared statement. If this routine returns 0, that means the prepared statement returns no data (for example an UPDATE). However, just because this routine returns a positive number does not mean that one or more rows of data will be returned. A SELECT statement will always have a positive **SQCloudVMColumnCount** but depending on the WHERE clause constraints and the table content, it might return no rows.\n\nThis function resembles the sqlite3_column_count SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\nReturn value\nAn `int` with the number of columns.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // count the number of columns\n int count = SQCloudVMColumnCount(vm);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMColumnCount.mdx","digest":"97d3cfb15e0f27e2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindDouble","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindInt","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindInt64","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindNull","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindText","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindBlob","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMBindZeroBlob","filePath":"sqlite-cloud/sdks/c/SQCloudVMBind","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmbind","data":{"title":"SQCloudVMBind","description":"SQCloud VM C/C++ Interface SQCloudVMBind","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudVMBindDouble (SQCloudVM *vm, int index, double value);\nbool SQCloudVMBindInt (SQCloudVM *vm, int index, int value);\nbool SQCloudVMBindInt64 (SQCloudVM *vm, int index, int64_t value);\nbool SQCloudVMBindNull (SQCloudVM *vm, int index);\nbool SQCloudVMBindText (SQCloudVM *vm, int index, const char *value, int32_t len);\nbool SQCloudVMBindBlob (SQCloudVM *vm, int index, void *value, int32_t len);\nbool SQCloudVMBindZeroBlob (SQCloudVM *vm, int index, int64_t len);\n```\n\n### Description\nBind a value to a compiled SQL statement.\nIn the SQL statement text input to [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile), literals may be replaced by a parameter that matches one of following templates:\n* ?\n* ?NNN\n* :VVV\n* @VVV\n* $VVV\n\nIn the templates above, NNN represents an integer literal, and VVV represents an alphanumeric identifier. The values of these parameters can be set using the SQCloudVMBind*() routines defined here.\nThese functions resemble the sqlite3_bind_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: Represents the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1. When the same named SQL parameter is used more than once, second and subsequent occurrences have the same index as the first occurrence. The index for named parameters can be looked up using the [SQCloudVMBindParameterIndex](/docs/sqlite-cloud/sdks/c/sqcloudvmbindparameterindex) API if desired. The index for \"?NNN\" parameters is the value of NNN.\n* **value**: The the value to bind to the parameter.\n* **len**: The number of bytes in the parameter. To be clear: the value is the number of bytes in the value, not the number of characters. \n\n### Return value\nIf the value is successfully bound without any errors, the function will return `true`. If an error occurs during the binding process, the function will return `false`.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1, col2, col3, col4) VALUES (?1, ?2, ?3, ?4);\", -1, NULL);\n\n // bind values\n bool r1 = SQCloudVMBindText(vm, 1, \"Hello World\", );\n bool r2 = SQCloudVMBindInt(vm, 2, 42);\n bool r3 = SQCloudVMBindDouble(vm, 3, 3.1415);\n bool r4 = SQCloudVMBindNull(vm, 4);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMBind.mdx","digest":"b1257f19871c6ee2","deferredRender":true,"collection":"docs"}},{"title":"SQCloudVMColumnBlob","filePath":"sqlite-cloud/sdks/c/SQCloudVMColumn","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmcolumn","data":{"title":"SQCloudVMColumn","description":"SQCloud VM C/C++ Interface SQCloudVMColumn","customClass":"","category":"sdks","status":"publish"},"body":"```c\nconst void *SQCloudVMColumnBlob (SQCloudVM *vm, int index, uint32_t *len);\nconst char *SQCloudVMColumnText (SQCloudVM *vm, int index, uint32_t *len);\ndouble SQCloudVMColumnDouble (SQCloudVM *vm, int index);\nint SQCloudVMColumnInt32 (SQCloudVM *vm, int index);\nint64_t SQCloudVMColumnInt64 (SQCloudVM *vm, int index);\nint64_t SQCloudVMColumnLen (SQCloudVM *vm, int index);\nSQCLOUD_VALUE_TYPE SQCloudVMColumnType (SQCloudVM *vm, int index);\n```\n\n### Description\nThese routines return information about a single column of the current result row of a query.\nThese functions resemble the sqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; isqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; isqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; isqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; isqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; isqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; isqlite3_column_* SQLite APIs. \n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n* **index**: The index of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using [SQCloudVMColumnCount](/docs/sqlite-cloud/sdks/c/sqcloudvmcolumncount).\n* **len**: The number of bytes of the returned value.\n\nThe **SQCloudVMColumnType** routine returns the datatype code for the initial data type of the result column. The returned value is one of following:\n\n* VALUE_INTEGER\n* VALUE_FLOAT\n* VALUE_TEXT\n* VALUE_BLOB\n* VALUE_NULL\n\nThe return value of **SQCloudVMColumnType** can be used to decide which of the first five interface should be used to extract the column value. The value returned by **SQCloudVMColumnType** is only meaningful if no automatic type conversions have occurred for the value in question.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"SELECT * FROM table1 LIMIT1;\", -1, NULL);\n\n // execute the query\n SQCloudStep(vm);\n\n // retrieve columns\n int count = SQCloudVMColumnCount(vm);\n\n for (int i=0; i\nIf you need to get the last inserted rowid from a SQCloudConnection object you can send a `DATABASE GET ROWID` command.\n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nAn `int64_t` with the most recent rowid.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // get the rowid\n int64_t rowid = SQCloudVMLastRowID(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMLastRowID.mdx","digest":"9c811d3a5ee1843d","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMChanges","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmchanges","data":{"title":"SQCloudVMChanges","description":"SQCloud VM C/C++ Interface SQCloudVMChanges","customClass":"","category":"sdks","status":"publish"},"body":"import Callout from \"@commons-components/Information/Callout.astro\"\n\n```c\nint64_t SQCloudVMChanges (SQCloudVM *vm);\n```\n\n### Description\nThis function returns the number of rows modified, inserted or deleted by the most recently completed INSERT, UPDATE or DELETE statement. Executing any other type of SQL statement does not modify the value returned by **SQCloudVMChanges**. Only changes made directly by the INSERT, UPDATE or DELETE statement are considered, auxiliary changes caused by triggers, foreign key actions or REPLACE constraint resolution are not counted.\n\n\nIf you need to get the changes from a SQCloudConnection object you can send a `DATABASE GET CHANGES` command.\n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n\n### Return value\nAn `int64_t` with the number of changes.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // count changes\n int64_t changes = SQCloudVMChanges(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMChanges.mdx","digest":"0ef6ccde3dd12609","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudVMTotalChanges","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudvmtotalchanges","data":{"title":"SQCloudVMTotalChanges","description":"SQCloud VM C/C++ Interface SQCloudVMTotalChanges","customClass":"","category":"sdks","status":"publish"},"body":"import Callout from \"@commons-components/Information/Callout.astro\"\n\n```c\nint64_t SQCloudVMTotalChanges (SQCloudVM *vm);\n```\n\n### Description\nThi function returns the total number of rows inserted, modified or deleted by all INSERT, UPDATE or DELETE statements completed since the database connection was opened, including those executed as part of trigger programs. Executing any other type of SQL statement does not affect the value returned by **SQCloudVMTotalChanges**. Changes made as part of foreign key actions are included in the count, but those made as part of REPLACE constraint resolution are not. Changes to a view that are intercepted by INSTEAD OF triggers are not counted.\n\n\n\nIf you need to get the total changes from a SQCloudConnection object you can send a `DATABASE GET TOTAL CHANGES` command.\n\n\n### Parameters\n* **vm**: A valid VM obtained by [SQCloudVMCompile](/docs/sqlite-cloud/sdks/c/sqcloudvmcompile).\n\n### Return value\nAn `int64_t` with the number of total changes.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // compile the INSERT SQL statement\n SQCloudVM *vm = SQCloudVMCompile(conn, \"INSERT INTO table1 (col1) VALUES ('Hello World');\", -1, NULL);\n\n // execute the previously compiled statement\n SQCLOUD_RESULT_TYPE type = SQCloudVMStep(vm);\n\n // count total changes\n int64_t changes = SQCloudVMTotalChanges(vm);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudVMTotalChanges.mdx","digest":"65fe3edb566fdbf5","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudBlobOpen","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudblobopen","data":{"title":"SQCloudBlobOpen","description":"SQCloud Blob C/C++ Interface SQCloudBlobOpen","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudBlob *SQCloudBlobOpen (SQCloudConnection *connection, const char *dbname, const char *tablename, const char *colname, int64_t rowid, bool wrflag);\n```\n\n### Description\nThe **SQCloudBlobOpen** interface opens a BLOB for incremental I/O. This interfaces opens a handle to the BLOB located in row rowid, column colname, table tablename in database dbname; in other words, the same BLOB that would be selected by: `SELECT colname FROM dbname.tablename WHERE rowid = rowid;`\n\nThis function fails if any of the following conditions are true:\n* Database **dbname** does not exist\n* Table **tablename** does not exist within database dbname\n* Table **tablename** is a WITHOUT ROWID table\n* Column **colname** does not exist\n* Row **rowid** is not present in the table\n* The specified column of row **rowid** contains a value that is not a TEXT or BLOB value\n* Column **colname** is part of an index, PRIMARY KEY or UNIQUE constraint and the blob is being opened for read/write access\n* Foreign key constraints are enabled, column **colname** is part of a child key definition and the blob is being opened for read/write access\n\nThis function resembles the sqlite3_blob_open SQLite API. \n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **dbname**: symbolic name of the database (usually `main`, if NULL `main` is used)\n* **tablename**: table name that contains the BLOB column \n* **colname**: name of the BLOB column\n* **rowid**: rowid of the BLOB to open\n* **wrflag**: if 0 the BLOB is opened for read-only access, otherwise the BLOB is opened for read and write access.\n\n\n### Return value\nAn SQCloudBlob opaque datatype.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // open a BLOB for reading\n SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, \"mytable\", \"mycolumn\", 1, 0);\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudBlobOpen.mdx","digest":"2570a60e120043ee","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudBlobReOpen","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudblobreopen","data":{"title":"SQCloudBlobReOpen","description":"SQCloud Blob C/C++ Interface SQCloudBlobReOpen","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudBlobReOpen (SQCloudBlob *blob, int64_t rowid);\n```\n\n### Description\nThis function is used to move an existing BLOB handle so that it points to a different row of the same database table. The new row is identified by the **rowid** value passed as the second argument. Only the row can be changed. The database, table and column on which the blob handle is open remain the same.\n\nThis function resembles the sqlite3_blob_reopen SQLite API. \n\n### Parameters\n* **blob**: a valid SQCloudBlob opaque datatype obtained by [SQCloudBlobOpen](/docs/sqlite-cloud/sdks/c/sqcloudblobopen)\n* **rowid**: rowid of the BLOB to open\n\n\n### Return value\n`true` if operation succed, otherwise `false`\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // open a BLOB for reading\n SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, \"mytable\", \"mycolumn\", 1, 0);\n\n // ...\n\n // re-open another rowid\n SQCloudBlobReOpen(blob, 2);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudBlobReOpen.mdx","digest":"fb71578235c0c6f4","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudBlobClose","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudblobclose","data":{"title":"SQCloudBlobClose","description":"SQCloud Blob C/C++ Interface SQCloudBlobClose","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudBlobClose (SQCloudBlob *blob);\n```\n\n### Description\nThis function closes an open BLOB handle. The BLOB handle is closed unconditionally. Even if this routine returns an error code, the handle is still closed. This function resembles the sqlite3_blob_close SQLite API. \n\n### Parameters\n* **blob**: a valid SQCloudBlob opaque datatype obtained by [SQCloudBlobOpen](/docs/sqlite-cloud/sdks/c/sqcloudblobopen)\n\n### Return value\n`true` if operation succed, otherwise `false`\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // open a BLOB for reading\n SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, \"mytable\", \"mycolumn\", 1, 0);\n\n // ...\n\n // close BLOB\n SQCloudBlobClose(blob);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudBlobClose.mdx","digest":"2f56b58713c14f5a","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudBlobBytes","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudblobbytes","data":{"title":"SQCloudBlobBytes","description":"SQCloud Blob C/C++ Interface SQCloudBlobBytes","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudBlobBytes (SQCloudBlob *blob);\n```\n\n### Description\nThis function returns the size in bytes of the BLOB accessible via the successfully opened BLOB handle in its only argument.\nThe incremental blob I/O routines can only read or overwriting existing blob content; they cannot change the size of a blob.\n\nThis function resembles the sqlite3_blob_bytes SQLite API. \n\n### Parameters\n* **blob**: a valid SQCloudBlob opaque datatype obtained by [SQCloudBlobOpen](/docs/sqlite-cloud/sdks/c/sqcloudblobopen)\n\n### Return value\nAn `int` value with the size in bytes of the BLOB.\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // open a BLOB for reading\n SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, \"mytable\", \"mycolumn\", 1, 0);\n\n // get BLOB size\n int size = SQCloudBlobBytes(blob);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudBlobBytes.mdx","digest":"f413605036cb4f8a","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudBlobRead","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudblobread","data":{"title":"SQCloudBlobRead","description":"SQCloud Blob C/C++ Interface SQCloudBlobRead","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudBlobRead (SQCloudBlob *blob, void *buffer, int blen, int offset);\n```\n\n### Description\nThe **SQCloudBlobRead** function is used to read data from an open BLOB handle into a caller-supplied buffer. **blen** bytes of data are copied into buffer **buffer** from the open BLOB, starting at offset **offset**.\n\nThis function resembles the sqlite3_blob_read SQLite API. \n\n### Parameters\n* **blob**: a valid SQCloudBlob opaque datatype obtained by [SQCloudBlobOpen](/docs/sqlite-cloud/sdks/c/sqcloudblobopen)\n* **buffer**: an user-supplied pre-allocated buffer\n* **blen**: the length of the input buffer\n* **offset**: the offset value set to where to start the read operation\n\n### Return value\n-1 in case of error, otherwise it returns the len of the read operation\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // open a BLOB for reading\n SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, \"mytable\", \"mycolumn\", 1, 0);\n\n // read from BLOB at offset 0\n char buffer[512];\n int len = SQCloudBlobRead(blob, buffer, (int)sizeof(buffer), 0);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudBlobRead.mdx","digest":"0c13f483963ca2a6","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudBlobWrite","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudblobwrite","data":{"title":"SQCloudBlobWrite","description":"SQCloud Blob C/C++ Interface SQCloudBlobWrite","customClass":"","category":"sdks","status":"publish"},"body":"```c\nint SQCloudBlobWrite (SQCloudBlob *blob, const void *buffer, int blen, int offset);\n```\n\n### Description\nThe **SQCloudBlobWrite** function is used to write data into an open BLOB handle from a caller-supplied buffer.\n**blen** bytes of data are copied from the buffer **buffer**into the open BLOB, starting at offset **offset**.\n\nThis function resembles the sqlite3_blob_write SQLite API. \n\n### Parameters\n* **blob**: a valid SQCloudBlob opaque datatype obtained by [SQCloudBlobOpen](/docs/sqlite-cloud/sdks/c/sqcloudblobopen)\n* **buffer**: an user-supplied pre-allocated buffer\n* **blen**: the length of the input buffer\n* **offset**: the offset value set to where to start the write operation\n\n### Return value\n-1 in case of error, otherwise 1\n\n### Example\n```c\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // choose a database first\n SQCloudResult *r = SQCloudExec(conn, \"USE DATABASE mydatabase.sqlite;\");\n\n // open a BLOB for writing\n SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, \"mytable\", \"mycolumn\", 1, 1);\n\n // write in BLOB starting offset 0\n char buffer[512] = {0};\n int len = SQCloudBlobWrite(blob, buffer, (int)sizeof(buffer), 0);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudBlobWrite.mdx","digest":"d8de65390822e268","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudSetPubSubCallback","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudsetpubsubcallback","data":{"title":"SQCloudSetPubSubCallback","description":"SQCloud Pub/Sub C/C++ Interface SQCloudSetPubSubCallback","customClass":"","category":"sdks","status":"publish"},"body":"```c\nvoid SQCloudSetPubSubCallback (SQCloudConnection *connection, SQCloudPubSubCB callback, void *data);\n```\n\n### Description\nBy using **SQCloudSetPubSubCallback**, you can set a callback function that will be automatically triggered each time a notification is received. It's possible to call this function multiple times, but it will be executed only once. If you don't set a callback function, your C code won't be able to read any notifications sent by the Pub/Sub subsystem. The callback function is executed in an independent secondary thread, which allows the main thread to perform other commands without interruption.\n\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **callback**: the C callback to be called in each notification\n* **data**: custom data to be transparently passed to the callback\n\n### Callback\n```c\nvoid pubsub_callback (SQCloudConnection *connection, SQCloudResult *result, void *data);\n```\n\n### Return value\nNothing.\n\n### Example\n```c\n\nstatic my_callback(SQCloudConnection *connection, SQCloudResult *result, void *data) {\n // dump JSON notification\n SQCloudResultDump(connection, result);\n}\n\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // set pub/sub callback\n SQCloudSetPubSubCallback(conn, my_callback, NULL);\n\n // start listening to a CHANNEL\n SQCloudExec(conn, \"LISTEN channel1;\");\n\n // ...\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudSetPubSubCallback.mdx","digest":"4464f22869d43eb6","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudSetPubSubOnly","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqcloudsetpubsubonly","data":{"title":"SQCloudSetPubSubOnly","description":"SQCloud Pub/Sub C/C++ Interface SQCloudSetPubSubOnly","customClass":"","category":"sdks","status":"publish"},"body":"```c\nSQCloudResult *SQCloudSetPubSubOnly (SQCloudConnection *connection);\n```\n\n### Description\nWhen Pub/Sub is activated (after calling [SQCloudSetPubSubCallback](/docs/sqlite-cloud/sdks/c/sqcloudsetpubsubcallback)) there are two sockets associated to the SQCloudConnection connection. The **SQCloudSetPubSubOnly** function closes the **main** socket, leaving the **pub/sub** socket opened and ready to receive incoming notifications from subscripted channels and tables.\n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n\n### Return value\nAn OK result is succesfully executed, otherwise an error.\n\n### Example\n```c\nstatic my_callback(SQCloudConnection *connection, SQCloudResult *result, void *data) {\n // dump JSON notification\n // more about the JSON format: https://docs.sqlitecloud.io/docs/introduction/pubsub_payload\n SQCloudResultDump(connection, result);\n}\n\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // set pub/sub callback\n SQCloudSetPubSubCallback(conn, my_callback, NULL);\n\n // start listening to a CHANNEL\n SQCloudExec(conn, \"LISTEN channel1;\");\n\n // close main socket\n SQCloudSetPubSubOnly(conn);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudSetPubSubOnly.mdx","digest":"2d8201d49bae8810","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudUploadDatabase","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouduploaddatabase","data":{"title":"SQCloudUploadDatabase","description":"SQCloud Basic C/C++ Interface SQCloudUploadDatabase","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudUploadDatabase (SQCloudConnection *connection, const char *dbname, const char *key, void *xdata, int64_t dbsize,\n int (*xCallback)(void *xdata, void *buffer, uint32_t *blen, int64_t ntot, int64_t nprogress));\n```\n\n### Description\nInitiate an SQLite database upload to an already connected SQLite Cloud node. \n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **dbname**: the name of the database on server-side once uploaded will be completed\n* **key**: encryption database key (if any)\n* **xdata**: a pointer to an opaque datatype that will be passed as-is to the callback\n* **dbsize**: original database size\n* **xcallback**: callback that will be automatically called to read from the input database file\n\n### Return value\n`true` if upload is succesfully completed.\n\n### Example\n```c\n\n#define DATABASE_PATH \"/full_path_to/database.sqlite\"\n\n// convenient struct to be used with SQCloudUploadDatabase\ntypedef struct {\n void *ptr;\n int fd;\n} SQCloudData;\n\nstatic int do_internal_read_cb (void *xdata, void *buffer, uint32_t *blen, int64_t ntot, int64_t nprogress) {\n int fd = ((SQCloudData *)xdata)->fd;\n \n ssize_t nread = read(fd, buffer, (size_t)*blen);\n if (nread == -1) return -1;\n \n if (nread == 0) printf(\"UPLOAD COMPLETE\\n\\n\");\n else printf(\"%.2f%% \", ((double)(nprogress+nread) / (double)ntot) * 100.0);\n \n *blen = (uint32_t)nread;\n return 0;\n}\n\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // open file in read-only mode (database must not be in use)\n int fd = file_open_read(DATABASE_PATH);\n if (fd < 0) {\n printf(\"Unable to open database file %s\\n\", DATABASE_PATH);\n return false;\n }\n \n // get file size (to have a nice progress stat)\n int64_t dbsize = file_size(fd);\n if (dbsize < 0) dbsize = 0;\n\n SQCloudData data = {.ptr = NULL, .fd = fd};\n bool result = SQCloudUploadDatabase(conn, \"database.sqlite\", NULL, (void *)&data, dbsize, do_internal_read_cb);\n close(fd);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudUploadDatabase.mdx","digest":"b8e3f31f7a358bed","deferredRender":true,"collection":"docs"}},{"filePath":"sqlite-cloud/sdks/c/SQCloudDownloadDatabase","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/c/sqclouddownloaddatabase","data":{"title":"SQCloudDownloadDatabase","description":"SQCloud Basic C/C++ Interface SQCloudDownloadDatabase","customClass":"","category":"sdks","status":"publish"},"body":"```c\nbool SQCloudDownloadDatabase (SQCloudConnection *connection, const char *dbname, void *xdata,\n int (*xCallback)(void *xdata, const void *buffer, uint32_t blen, int64_t ntot, int64_t nprogress));\n```\n\n### Description\nInitiate an SQLite database download from an already connected SQLite Cloud node. \n\n### Parameters\n* **connection**: a valid connection object obtained by [SQCloudConnect](/docs/sqlite-cloud/sdks/c/sqcloudconnect) or [SQCloudConnectWithString](/docs/sqlite-cloud/sdks/c/sqcloudconnectwithstring)\n* **dbname**: the name of the database to download\n* **xdata**: a pointer to an opaque datatype that will be passed as-is to the callback\n* **xcallback**: callback that will be automatically called to read from the input database file\n\n### Return value\n`true` if download is succesfully completed.\n\n### Example\n```c\n#define DATABASE_PATH \"/full_path_to/database.sqlite\"\n\n// convenient struct to be used with SQCloudDownloadDatabase\ntypedef struct {\n void *ptr;\n int fd;\n} SQCloudData;\n\nstatic int do_internal_download_cb (void *xdata, const void *buffer, uint32_t blen, int64_t ntot, int64_t nprogress) {\n if (blen) {\n // retrieve file descriptor\n int fd = ((SQCloudData *)xdata)->fd;\n\n // write data\n if (write(fd, buffer, (size_t)blen) != blen) {\n printf(\"\\nError while writing data to file.\\n\");\n return -1;\n }\n }\n \n // display a simple text progress\n printf(\"%.2f%% \", ((double)nprogress / (double)ntot) * 100.0);\n \n // check if it is final step\n if (ntot == nprogress) printf(\"\\n\\n\");\n \n // means no error and continue the loop\n return 0;\n}\n\nint main (int argc, const char * argv[]) {\n // setup config\n SQCloudConfig config = {0};\n config.username = \"myusername\";\n config.password = \"mypassword\"\n\n SQCloudConnection *conn = SQCloudConnect(\"myproject.sqlite.cloud\", SQCLOUD_DEFAULT_PORT, &config);\n if (SQCloudIsError(conn)) {\n printf(\"ERROR connecting: %s (%d)\\n\", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));\n return -1;\n } else {\n printf(\"Connection to host OK...\\n\\n\");\n }\n\n // create file\n int fd = file_create(DATABASE_PATH);\n if (fd < 0) {\n printf(\"Unable to create output file %s\\n\", DATABASE_PATH);\n return false;\n }\n \n SQCloudData data = {.ptr = NULL, .fd = fd};\n bool result = SQCloudDownloadDatabase(conn, \"database.sqlite\", (void *)&data, do_internal_download_cb);\n if (!result) {\n // handle error here\n }\n \n close(fd);\n}\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/c/SQCloudDownloadDatabase.mdx","digest":"208a8d96dbf11663","deferredRender":true,"collection":"docs"}},{"title":"Introduction","type":"inner","filePath":"sdk-js-introduction","level":1,"entry":{"id":"sdk-js-introduction","data":{"title":"JS SDK Introduction","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"\n \"npm\n\n
    \n\n \"Build\n\n
    \n\n \"Downloads\"\n\n
    \n\n \"Issues\"\n\n
    \n\n \"codecov\"\n\n\n## Install\n\n```bash\nnpm install @sqlitecloud/drivers\n```\n\n## Usage\n\n```ts\nimport { Database } from '@sqlitecloud/drivers'\n\nlet database = new Database('sqlitecloud://user:password@xxx.sqlite.cloud:8860/chinook.db')\n\nlet name = 'Breaking The Rules'\n\nlet results = await database.sql`SELECT * FROM tracks WHERE name = ${name}`\n// => returns [{ AlbumId: 1, Name: 'Breaking The Rules', Composer: 'Angus Young... }]\n```\n\nUse [Database.sql](/docs/sqlite-cloud/sdks/js/classes/database#sql) to execute prepared statements or plain SQL queries asynchronously. This method returns an array of rows for SELECT queries and supports the standard syntax for UPDATE, INSERT, and DELETE.\n\nWe aim for full compatibility with the established sqlite3 API, with the primary distinction being that our driver connects to SQLiteCloud databases. This allows you to migrate your SQLite to the cloud while continuing to use your existing codebase.\n\nThe package is developed entirely in TypeScript and is fully compatible with JavaScript. It doesn't require any native libraries. This makes it a straightforward and effective tool for managing cloud-based databases in a familiar SQLite environment.\n\n## More\n\nHow do I deploy SQLite in the cloud?\n
    \nHow do I connect SQLite cloud with Javascript?\n
    \nHow can I contribute or suggest features?","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/introduction.mdx","digest":"6c35305c01b39034","deferredRender":true,"collection":"docs"}},{"title":"Database","filePath":"sqlite-cloud/sdks/js/classes/Database","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/classes/database","data":{"title":"Database","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"Creating a Database object automatically opens a connection to the SQLite database.\nWhen the connection is established the Database object emits an open event and calls\nthe optional provided callback. If the connection cannot be established an error event\nwill be emitted and the optional callback is called with the error information.\n\n## Hierarchy\n\n- `EventEmitter`\n\n ↳ **`Database`**\n\n## Table of contents\n\n### Constructors\n\n- [constructor](database#constructor)\n\n### Properties\n\n- [config](database#config)\n- [connections](database#connections)\n- [prefixed](database#prefixed)\n\n### Methods\n\n- [addListener](database#addlistener)\n- [all](database#all)\n- [close](database#close)\n- [configure](database#configure)\n- [each](database#each)\n- [emit](database#emit)\n- [emitEvent](database#emitevent)\n- [eventNames](database#eventnames)\n- [exec](database#exec)\n- [get](database#get)\n- [getConfiguration](database#getconfiguration)\n- [getConnection](database#getconnection)\n- [handleError](database#handleerror)\n- [interrupt](database#interrupt)\n- [listenerCount](database#listenercount)\n- [listeners](database#listeners)\n- [loadExtension](database#loadextension)\n- [off](database#off)\n- [on](database#on)\n- [once](database#once)\n- [prepare](database#prepare)\n- [processContext](database#processcontext)\n- [removeAllListeners](database#removealllisteners)\n- [removeListener](database#removelistener)\n- [run](database#run)\n- [sql](database#sql)\n- [verbose](database#verbose)\n\n## Constructors\n\n### constructor\n\n• **new Database**(`config`, `callback?`): [`Database`](database)\n\nCreate and initialize a database from a full configuration object, or connection string\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `config` | `string` \\| [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig) |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n[`Database`](database)\n\n#### Overrides\n\nEventEmitter.constructor\n\n#### Defined in\n\nsrc/drivers/database.ts:33\n\n• **new Database**(`config`, `mode?`, `callback?`): [`Database`](database)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `config` | `string` \\| [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig) |\n| `mode?` | `number` |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n[`Database`](database)\n\n#### Overrides\n\nEventEmitter.constructor\n\n#### Defined in\n\nsrc/drivers/database.ts:34\n\n## Properties\n\n### config\n\n• `Private` **config**: [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig)\n\nConfiguration used to open database connections\n\n#### Defined in\n\nsrc/drivers/database.ts:57\n\n___\n\n### connections\n\n• `Private` **connections**: [`SQLiteCloudConnection`](sqlitecloudconnection)[] = `[]`\n\nDatabase connections\n\n#### Defined in\n\nsrc/drivers/database.ts:60\n\n___\n\n### prefixed\n\n▪ `Static` **prefixed**: `string` \\| `boolean`\n\n#### Inherited from\n\nEventEmitter.prefixed\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:9\n\n## Methods\n\n### addListener\n\n▸ **addListener**\\<`T`\\>(`event`, `fn`, `context?`): [`Database`](database)\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n| `fn` | (...`args`: `any`[]) => `void` |\n| `context?` | `any` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Inherited from\n\nEventEmitter.addListener\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:45\n\n___\n\n### all\n\n▸ **all**\\<`T`\\>(`sql`, `callback?`): [`Database`](database)\n\nRuns the SQL query with the specified parameters and calls the callback\nwith all result rows afterwards. The function returns the Database object to\nallow for function chaining. The parameters are the same as the Database#run\nfunction, with the following differences: The signature of the callback is\nfunction(err, rows) {}. rows is an array. If the result set is empty, it will\nbe an empty array, otherwise it will have an object for each result row which\nin turn contains the values of that row, like the Database#get function.\nNote that it first retrieves all result rows and stores them in memory.\nFor queries that have potentially large result sets, use the Database#each\nfunction to retrieve all rows or Database#prepare followed by multiple Statement#get\ncalls to retrieve a previously unknown amount of rows.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `callback?` | `RowsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:273\n\n▸ **all**\\<`T`\\>(`sql`, `params`, `callback?`): [`Database`](database)\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `params` | `any` |\n| `callback?` | `RowsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:274\n\n___\n\n### close\n\n▸ **close**(`callback?`): `void`\n\nIf the optional callback is provided, this function will be called when the\ndatabase was closed successfully or when an error occurred. The first argument\nis an error object. When it is null, closing succeeded. If no callback is provided\nand an error occurred, an error event with the error object as the only parameter\nwill be emitted on the database object. If closing succeeded, a close event with no\nparameters is emitted, regardless of whether a callback was provided or not.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/database.ts:394\n\n___\n\n### configure\n\n▸ **configure**(`_option`, `_value`): [`Database`](database)\n\nSet a configuration option for the database\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `_option` | `string` |\n| `_value` | `any` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:190\n\n___\n\n### each\n\n▸ **each**\\<`T`\\>(`sql`, `callback?`, `complete?`): [`Database`](database)\n\nRuns the SQL query with the specified parameters and calls the callback once for each result row.\nThe function returns the Database object to allow for function chaining. The parameters are the\nsame as the Database#run function, with the following differences: The signature of the callback\nis function(err, row) {}. If the result set succeeds but is empty, the callback is never called.\nIn all other cases, the callback is called once for every retrieved row. The order of calls correspond\nexactly to the order of rows in the result set. After all row callbacks were called, the completion\ncallback will be called if present. The first argument is an error object, and the second argument\nis the number of retrieved rows. If you specify only one function, it will be treated as row callback,\nif you specify two, the first (== second to last) function will be the row callback, the last function\nwill be the completion callback. If you know that a query only returns a very limited number of rows,\nit might be more convenient to use Database#all to retrieve all rows at once. There is currently no\nway to abort execution.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `callback?` | `RowCallback`\\<`T`\\> |\n| `complete?` | `RowCountCallback` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:312\n\n▸ **each**\\<`T`\\>(`sql`, `params`, `callback?`, `complete?`): [`Database`](database)\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `params` | `any` |\n| `callback?` | `RowCallback`\\<`T`\\> |\n| `complete?` | `RowCountCallback` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:313\n\n___\n\n### emit\n\n▸ **emit**\\<`T`\\>(`event`, `...args`): `boolean`\n\nCalls each of the listeners registered for a given event.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n| `...args` | `any`[] |\n\n#### Returns\n\n`boolean`\n\n#### Inherited from\n\nEventEmitter.emit\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:32\n\n___\n\n### emitEvent\n\n▸ **emitEvent**(`event`, `...args`): `void`\n\nEmits given event with optional arguments on the next tick so callbacks can complete first\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `string` |\n| `...args` | `any`[] |\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/database.ts:160\n\n___\n\n### eventNames\n\n▸ **eventNames**(): (`string` \\| `symbol`)[]\n\nReturn an array listing the events for which the emitter has registered\nlisteners.\n\n#### Returns\n\n(`string` \\| `symbol`)[]\n\n#### Inherited from\n\nEventEmitter.eventNames\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:15\n\n___\n\n### exec\n\n▸ **exec**(`sql`, `callback?`): [`Database`](database)\n\nRuns all SQL queries in the supplied string. No result rows are retrieved.\nThe function returns the Database object to allow for function chaining.\nIf a query fails, no subsequent statements will be executed (wrap it in a\ntransaction if you want all or none to be executed). When all statements\nhave been executed successfully, or when an error occurs, the callback\nfunction is called, with the first parameter being either null or an error\nobject. When no callback is provided and an error occurs, an error event\nwill be emitted on the database object.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:368\n\n___\n\n### get\n\n▸ **get**\\<`T`\\>(`sql`, `callback?`): [`Database`](database)\n\nRuns the SQL query with the specified parameters and calls the callback with\na subsequent result row. The function returns the Database object to allow for\nfunction chaining. The parameters are the same as the Database#run function,\nwith the following differences: The signature of the callback is `function(err, row) {}`.\nIf the result set is empty, the second parameter is undefined, otherwise it is an\nobject containing the values for the first row. The property names correspond to\nthe column names of the result set. It is impossible to access them by column index;\nthe only supported way is by column name.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `callback?` | `RowCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:235\n\n▸ **get**\\<`T`\\>(`sql`, `params`, `callback?`): [`Database`](database)\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `params` | `any` |\n| `callback?` | `RowCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:236\n\n___\n\n### getConfiguration\n\n▸ **getConfiguration**(): [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig)\n\nReturns the configuration with which this database was opened.\nThe configuration is readonly and cannot be changed as there may\nbe multiple connections using the same configuration.\n\n#### Returns\n\n[`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig)\n\nA configuration object\n\n#### Defined in\n\nsrc/drivers/database.ts:176\n\n___\n\n### getConnection\n\n▸ **getConnection**(`callback`): `void`\n\nReturns first available connection from connection pool\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback` | `ResultsCallback`\\<[`SQLiteCloudConnection`](sqlitecloudconnection)\\> |\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/database.ts:67\n\n___\n\n### handleError\n\n▸ **handleError**(`connection`, `error`, `callback?`): `void`\n\nHandles an error by closing the connection, calling the callback and/or emitting an error event\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `connection` | ``null`` \\| [`SQLiteCloudConnection`](sqlitecloudconnection) |\n| `error` | `Error` |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/database.ts:117\n\n___\n\n### interrupt\n\n▸ **interrupt**(): `void`\n\nAllows the user to interrupt long-running queries. Wrapper around\nsqlite3_interrupt and causes other data-fetching functions to be\npassed an err with code = sqlite3.INTERRUPT. The database must be\nopen to use this function.\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/database.ts:429\n\n___\n\n### listenerCount\n\n▸ **listenerCount**(`event`): `number`\n\nReturn the number of listeners listening to a given event.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `string` \\| `symbol` |\n\n#### Returns\n\n`number`\n\n#### Inherited from\n\nEventEmitter.listenerCount\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:27\n\n___\n\n### listeners\n\n▸ **listeners**\\<`T`\\>(`event`): (...`args`: `any`[]) => `void`[]\n\nReturn the listeners registered for a given event.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n\n#### Returns\n\n(...`args`: `any`[]) => `void`[]\n\n#### Inherited from\n\nEventEmitter.listeners\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:20\n\n___\n\n### loadExtension\n\n▸ **loadExtension**(`_path`, `callback?`): [`Database`](database)\n\nLoads a compiled SQLite extension into the database connection object.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `_path` | `string` | - |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) | If provided, this function will be called when the extension was loaded successfully or when an error occurred. The first argument is an error object. When it is null, loading succeeded. If no callback is provided and an error occurred, an error event with the error object as the only parameter will be emitted on the database object. |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:413\n\n___\n\n### off\n\n▸ **off**\\<`T`\\>(`event`, `fn?`, `context?`, `once?`): [`Database`](database)\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n| `fn?` | (...`args`: `any`[]) => `void` |\n| `context?` | `any` |\n| `once?` | `boolean` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Inherited from\n\nEventEmitter.off\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:69\n\n___\n\n### on\n\n▸ **on**\\<`T`\\>(`event`, `fn`, `context?`): [`Database`](database)\n\nAdd a listener for a given event.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n| `fn` | (...`args`: `any`[]) => `void` |\n| `context?` | `any` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Inherited from\n\nEventEmitter.on\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:40\n\n___\n\n### once\n\n▸ **once**\\<`T`\\>(`event`, `fn`, `context?`): [`Database`](database)\n\nAdd a one-time listener for a given event.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n| `fn` | (...`args`: `any`[]) => `void` |\n| `context?` | `any` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Inherited from\n\nEventEmitter.once\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:54\n\n___\n\n### prepare\n\n▸ **prepare**\\<`T`\\>(`sql`, `...params`): [`Statement`](statement)\\<`T`\\>\n\nPrepares the SQL statement and optionally binds the specified parameters and\ncalls the callback when done. The function returns a Statement object.\nWhen preparing was successful, the first and only argument to the callback\nis null, otherwise it is the error object. When bind parameters are supplied,\nthey are bound to the prepared statement before calling the callback.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `...params` | `any`[] |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/database.ts:353\n\n___\n\n### processContext\n\n▸ **processContext**(`results?`): `undefined` \\| `Record`\\<`string`, `any`\\>\n\nSome queries like inserts or updates processed via run or exec may generate\nan empty result (eg. no data was selected), but still have some metadata.\nFor example the server may pass the id of the last row that was modified.\nIn this case the callback results should be empty but the context may contain\nadditional information like lastID, etc.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `results?` | `any` | Results received from the server |\n\n#### Returns\n\n`undefined` \\| `Record`\\<`string`, `any`\\>\n\nA context object if one makes sense, otherwise undefined\n\n**`See`**\n\nhttps://github.com/TryGhost/node-sqlite3/wiki/API#runsql--param---callback\n\n#### Defined in\n\nsrc/drivers/database.ts:141\n\n___\n\n### removeAllListeners\n\n▸ **removeAllListeners**(`event?`): [`Database`](database)\n\nRemove all listeners, or those of the specified event.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event?` | `string` \\| `symbol` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Inherited from\n\nEventEmitter.removeAllListeners\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:79\n\n___\n\n### removeListener\n\n▸ **removeListener**\\<`T`\\>(`event`, `fn?`, `context?`, `once?`): [`Database`](database)\n\nRemove the listeners of a given event.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `string` \\| `symbol` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `event` | `T` |\n| `fn?` | (...`args`: `any`[]) => `void` |\n| `context?` | `any` |\n| `once?` | `boolean` |\n\n#### Returns\n\n[`Database`](database)\n\n#### Inherited from\n\nEventEmitter.removeListener\n\n#### Defined in\n\nnode_modules/eventemitter3/index.d.ts:63\n\n___\n\n### run\n\n▸ **run**\\<`T`\\>(`sql`, `callback?`): [`Database`](database)\n\nRuns the SQL query with the specified parameters and calls the callback afterwards.\nThe callback will contain the results passed back from the server, for example in the\ncase of an update or insert, these would contain the number of rows modified, etc.\nIt does not retrieve any result data. The function returns the Database object for\nwhich it was called to allow for function chaining.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `callback?` | `ResultsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:202\n\n▸ **run**\\<`T`\\>(`sql`, `params`, `callback?`): [`Database`](database)\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `params` | `any` |\n| `callback?` | `ResultsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:203\n\n___\n\n### sql\n\n▸ **sql**(`sql`, `...values`): `Promise`\\<`any`\\>\n\nSql is a promise based API for executing SQL statements. You can\npass a simple string with a SQL statement or a template string\nusing backticks and parameters in ${parameter} format. These parameters\nwill be properly escaped and quoted like when using a prepared statement.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `sql` | `string` \\| `TemplateStringsArray` | A sql string or a template string in `backticks` format |\n| `...values` | `any`[] | - |\n\n#### Returns\n\n`Promise`\\<`any`\\>\n\nAn array of rows in case of selections or an object with\nmetadata in case of insert, update, delete.\n\n#### Defined in\n\nsrc/drivers/database.ts:447\n\n___\n\n### verbose\n\n▸ **verbose**(): [`Database`](database)\n\nEnable verbose mode\n\n#### Returns\n\n[`Database`](database)\n\n#### Defined in\n\nsrc/drivers/database.ts:181","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/classes/Database.md","digest":"aff806dfba751fb8","rendered":{"html":"

    Creating a Database object automatically opens a connection to the SQLite database.\nWhen the connection is established the Database object emits an open event and calls\nthe optional provided callback. If the connection cannot be established an error event\nwill be emitted and the optional callback is called with the error information.

    \n

    Hierarchy

    \n
      \n
    • \n

      EventEmitter

      \n

      Database

      \n
    • \n
    \n

    Table of contents

    \n

    Constructors

    \n\n

    Properties

    \n\n

    Methods

    \n\n

    Constructors

    \n

    constructor

    \n

    new Database(config, callback?): Database

    \n

    Create and initialize a database from a full configuration object, or connection string

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    configstring | SQLiteCloudConfig
    callback?ErrorCallback
    \n

    Returns

    \n

    Database

    \n

    Overrides

    \n

    EventEmitter.constructor

    \n

    Defined in

    \n

    src/drivers/database.ts:33

    \n

    new Database(config, mode?, callback?): Database

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    configstring | SQLiteCloudConfig
    mode?number
    callback?ErrorCallback
    \n

    Returns

    \n

    Database

    \n

    Overrides

    \n

    EventEmitter.constructor

    \n

    Defined in

    \n

    src/drivers/database.ts:34

    \n

    Properties

    \n

    config

    \n

    Private config: SQLiteCloudConfig

    \n

    Configuration used to open database connections

    \n

    Defined in

    \n

    src/drivers/database.ts:57

    \n
    \n

    connections

    \n

    Private connections: SQLiteCloudConnection[] = []

    \n

    Database connections

    \n

    Defined in

    \n

    src/drivers/database.ts:60

    \n
    \n

    prefixed

    \n

    Static prefixed: string | boolean

    \n

    Inherited from

    \n

    EventEmitter.prefixed

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:9

    \n

    Methods

    \n

    addListener

    \n

    addListener&#x3C;T>(event, fn, context?): Database

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    fn(…args: any[]) => void
    context?any
    \n

    Returns

    \n

    Database

    \n

    Inherited from

    \n

    EventEmitter.addListener

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:45

    \n
    \n

    all

    \n

    all&#x3C;T>(sql, callback?): Database

    \n

    Runs the SQL query with the specified parameters and calls the callback\nwith all result rows afterwards. The function returns the Database object to\nallow for function chaining. The parameters are the same as the Database#run\nfunction, with the following differences: The signature of the callback is\nfunction(err, rows) {}. rows is an array. If the result set is empty, it will\nbe an empty array, otherwise it will have an object for each result row which\nin turn contains the values of that row, like the Database#get function.\nNote that it first retrieves all result rows and stores them in memory.\nFor queries that have potentially large result sets, use the Database#each\nfunction to retrieve all rows or Database#prepare followed by multiple Statement#get\ncalls to retrieve a previously unknown amount of rows.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    callback?RowsCallback&#x3C;T>
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:273

    \n

    all&#x3C;T>(sql, params, callback?): Database

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    paramsany
    callback?RowsCallback&#x3C;T>
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:274

    \n
    \n

    close

    \n

    close(callback?): void

    \n

    If the optional callback is provided, this function will be called when the\ndatabase was closed successfully or when an error occurred. The first argument\nis an error object. When it is null, closing succeeded. If no callback is provided\nand an error occurred, an error event with the error object as the only parameter\nwill be emitted on the database object. If closing succeeded, a close event with no\nparameters is emitted, regardless of whether a callback was provided or not.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callback?ErrorCallback
    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/database.ts:394

    \n
    \n

    configure

    \n

    configure(_option, _value): Database

    \n

    Set a configuration option for the database

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    _optionstring
    _valueany
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:190

    \n
    \n

    each

    \n

    each&#x3C;T>(sql, callback?, complete?): Database

    \n

    Runs the SQL query with the specified parameters and calls the callback once for each result row.\nThe function returns the Database object to allow for function chaining. The parameters are the\nsame as the Database#run function, with the following differences: The signature of the callback\nis function(err, row) {}. If the result set succeeds but is empty, the callback is never called.\nIn all other cases, the callback is called once for every retrieved row. The order of calls correspond\nexactly to the order of rows in the result set. After all row callbacks were called, the completion\ncallback will be called if present. The first argument is an error object, and the second argument\nis the number of retrieved rows. If you specify only one function, it will be treated as row callback,\nif you specify two, the first (== second to last) function will be the row callback, the last function\nwill be the completion callback. If you know that a query only returns a very limited number of rows,\nit might be more convenient to use Database#all to retrieve all rows at once. There is currently no\nway to abort execution.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    callback?RowCallback&#x3C;T>
    complete?RowCountCallback
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:312

    \n

    each&#x3C;T>(sql, params, callback?, complete?): Database

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    paramsany
    callback?RowCallback&#x3C;T>
    complete?RowCountCallback
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:313

    \n
    \n

    emit

    \n

    emit&#x3C;T>(event, ...args): boolean

    \n

    Calls each of the listeners registered for a given event.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    ...argsany[]
    \n

    Returns

    \n

    boolean

    \n

    Inherited from

    \n

    EventEmitter.emit

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:32

    \n
    \n

    emitEvent

    \n

    emitEvent(event, ...args): void

    \n

    Emits given event with optional arguments on the next tick so callbacks can complete first

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventstring
    ...argsany[]
    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/database.ts:160

    \n
    \n

    eventNames

    \n

    eventNames(): (string | symbol)[]

    \n

    Return an array listing the events for which the emitter has registered\nlisteners.

    \n

    Returns

    \n

    (string | symbol)[]

    \n

    Inherited from

    \n

    EventEmitter.eventNames

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:15

    \n
    \n

    exec

    \n

    exec(sql, callback?): Database

    \n

    Runs all SQL queries in the supplied string. No result rows are retrieved.\nThe function returns the Database object to allow for function chaining.\nIf a query fails, no subsequent statements will be executed (wrap it in a\ntransaction if you want all or none to be executed). When all statements\nhave been executed successfully, or when an error occurs, the callback\nfunction is called, with the first parameter being either null or an error\nobject. When no callback is provided and an error occurs, an error event\nwill be emitted on the database object.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    callback?ErrorCallback
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:368

    \n
    \n

    get

    \n

    get&#x3C;T>(sql, callback?): Database

    \n

    Runs the SQL query with the specified parameters and calls the callback with\na subsequent result row. The function returns the Database object to allow for\nfunction chaining. The parameters are the same as the Database#run function,\nwith the following differences: The signature of the callback is function(err, row) {}.\nIf the result set is empty, the second parameter is undefined, otherwise it is an\nobject containing the values for the first row. The property names correspond to\nthe column names of the result set. It is impossible to access them by column index;\nthe only supported way is by column name.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    callback?RowCallback&#x3C;T>
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:235

    \n

    get&#x3C;T>(sql, params, callback?): Database

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    paramsany
    callback?RowCallback&#x3C;T>
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:236

    \n
    \n

    getConfiguration

    \n

    getConfiguration(): SQLiteCloudConfig

    \n

    Returns the configuration with which this database was opened.\nThe configuration is readonly and cannot be changed as there may\nbe multiple connections using the same configuration.

    \n

    Returns

    \n

    SQLiteCloudConfig

    \n

    A configuration object

    \n

    Defined in

    \n

    src/drivers/database.ts:176

    \n
    \n

    getConnection

    \n

    getConnection(callback): void

    \n

    Returns first available connection from connection pool

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callbackResultsCallback&#x3C;SQLiteCloudConnection>
    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/database.ts:67

    \n
    \n

    handleError

    \n

    handleError(connection, error, callback?): void

    \n

    Handles an error by closing the connection, calling the callback and/or emitting an error event

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    connectionnull | SQLiteCloudConnection
    errorError
    callback?ErrorCallback
    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/database.ts:117

    \n
    \n

    interrupt

    \n

    interrupt(): void

    \n

    Allows the user to interrupt long-running queries. Wrapper around\nsqlite3_interrupt and causes other data-fetching functions to be\npassed an err with code = sqlite3.INTERRUPT. The database must be\nopen to use this function.

    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/database.ts:429

    \n
    \n

    listenerCount

    \n

    listenerCount(event): number

    \n

    Return the number of listeners listening to a given event.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventstring | symbol
    \n

    Returns

    \n

    number

    \n

    Inherited from

    \n

    EventEmitter.listenerCount

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:27

    \n
    \n

    listeners

    \n

    listeners&#x3C;T>(event): (…args: any[]) => void[]

    \n

    Return the listeners registered for a given event.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    \n

    Returns

    \n

    (…args: any[]) => void[]

    \n

    Inherited from

    \n

    EventEmitter.listeners

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:20

    \n
    \n

    loadExtension

    \n

    loadExtension(_path, callback?): Database

    \n

    Loads a compiled SQLite extension into the database connection object.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    _pathstring-
    callback?ErrorCallbackIf provided, this function will be called when the extension was loaded successfully or when an error occurred. The first argument is an error object. When it is null, loading succeeded. If no callback is provided and an error occurred, an error event with the error object as the only parameter will be emitted on the database object.
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:413

    \n
    \n

    off

    \n

    off&#x3C;T>(event, fn?, context?, once?): Database

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    fn?(…args: any[]) => void
    context?any
    once?boolean
    \n

    Returns

    \n

    Database

    \n

    Inherited from

    \n

    EventEmitter.off

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:69

    \n
    \n

    on

    \n

    on&#x3C;T>(event, fn, context?): Database

    \n

    Add a listener for a given event.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    fn(…args: any[]) => void
    context?any
    \n

    Returns

    \n

    Database

    \n

    Inherited from

    \n

    EventEmitter.on

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:40

    \n
    \n

    once

    \n

    once&#x3C;T>(event, fn, context?): Database

    \n

    Add a one-time listener for a given event.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    fn(…args: any[]) => void
    context?any
    \n

    Returns

    \n

    Database

    \n

    Inherited from

    \n

    EventEmitter.once

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:54

    \n
    \n

    prepare

    \n

    prepare&#x3C;T>(sql, ...params): Statement&#x3C;T>

    \n

    Prepares the SQL statement and optionally binds the specified parameters and\ncalls the callback when done. The function returns a Statement object.\nWhen preparing was successful, the first and only argument to the callback\nis null, otherwise it is the error object. When bind parameters are supplied,\nthey are bound to the prepared statement before calling the callback.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Tany
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    ...paramsany[]
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/database.ts:353

    \n
    \n

    processContext

    \n

    processContext(results?): undefined | Record&#x3C;string, any>

    \n

    Some queries like inserts or updates processed via run or exec may generate\nan empty result (eg. no data was selected), but still have some metadata.\nFor example the server may pass the id of the last row that was modified.\nIn this case the callback results should be empty but the context may contain\nadditional information like lastID, etc.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    results?anyResults received from the server
    \n

    Returns

    \n

    undefined | Record&#x3C;string, any>

    \n

    A context object if one makes sense, otherwise undefined

    \n

    See

    \n

    https://github.com/TryGhost/node-sqlite3/wiki/API#runsql—param---callback

    \n

    Defined in

    \n

    src/drivers/database.ts:141

    \n
    \n

    removeAllListeners

    \n

    removeAllListeners(event?): Database

    \n

    Remove all listeners, or those of the specified event.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    event?string | symbol
    \n

    Returns

    \n

    Database

    \n

    Inherited from

    \n

    EventEmitter.removeAllListeners

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:79

    \n
    \n

    removeListener

    \n

    removeListener&#x3C;T>(event, fn?, context?, once?): Database

    \n

    Remove the listeners of a given event.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Textends string | symbol
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    eventT
    fn?(…args: any[]) => void
    context?any
    once?boolean
    \n

    Returns

    \n

    Database

    \n

    Inherited from

    \n

    EventEmitter.removeListener

    \n

    Defined in

    \n

    node_modules/eventemitter3/index.d.ts:63

    \n
    \n

    run

    \n

    run&#x3C;T>(sql, callback?): Database

    \n

    Runs the SQL query with the specified parameters and calls the callback afterwards.\nThe callback will contain the results passed back from the server, for example in the\ncase of an update or insert, these would contain the number of rows modified, etc.\nIt does not retrieve any result data. The function returns the Database object for\nwhich it was called to allow for function chaining.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    callback?ResultsCallback&#x3C;T>
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:202

    \n

    run&#x3C;T>(sql, params, callback?): Database

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    paramsany
    callback?ResultsCallback&#x3C;T>
    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:203

    \n
    \n

    sql

    \n

    sql(sql, ...values): Promise&#x3C;any>

    \n

    Sql is a promise based API for executing SQL statements. You can\npass a simple string with a SQL statement or a template string\nusing backticks and parameters in ${parameter} format. These parameters\nwill be properly escaped and quoted like when using a prepared statement.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    sqlstring | TemplateStringsArrayA sql string or a template string in backticks format
    ...valuesany[]-
    \n

    Returns

    \n

    Promise&#x3C;any>

    \n

    An array of rows in case of selections or an object with\nmetadata in case of insert, update, delete.

    \n

    Defined in

    \n

    src/drivers/database.ts:447

    \n
    \n

    verbose

    \n

    verbose(): Database

    \n

    Enable verbose mode

    \n

    Returns

    \n

    Database

    \n

    Defined in

    \n

    src/drivers/database.ts:181

    ","metadata":{"headings":[{"depth":2,"slug":"hierarchy","text":"Hierarchy"},{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"constructors","text":"Constructors"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":3,"slug":"methods","text":"Methods"},{"depth":2,"slug":"constructors-1","text":"Constructors"},{"depth":3,"slug":"constructor","text":"constructor"},{"depth":4,"slug":"parameters","text":"Parameters"},{"depth":4,"slug":"returns","text":"Returns"},{"depth":4,"slug":"overrides","text":"Overrides"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":4,"slug":"parameters-1","text":"Parameters"},{"depth":4,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"overrides-1","text":"Overrides"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"config","text":"config"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"connections","text":"connections"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":3,"slug":"prefixed","text":"prefixed"},{"depth":4,"slug":"inherited-from","text":"Inherited from"},{"depth":4,"slug":"defined-in-4","text":"Defined in"},{"depth":2,"slug":"methods-1","text":"Methods"},{"depth":3,"slug":"addlistener","text":"addListener"},{"depth":4,"slug":"type-parameters","text":"Type parameters"},{"depth":4,"slug":"parameters-2","text":"Parameters"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"inherited-from-1","text":"Inherited from"},{"depth":4,"slug":"defined-in-5","text":"Defined in"},{"depth":3,"slug":"all","text":"all"},{"depth":4,"slug":"type-parameters-1","text":"Type parameters"},{"depth":4,"slug":"parameters-3","text":"Parameters"},{"depth":4,"slug":"returns-3","text":"Returns"},{"depth":4,"slug":"defined-in-6","text":"Defined in"},{"depth":4,"slug":"type-parameters-2","text":"Type parameters"},{"depth":4,"slug":"parameters-4","text":"Parameters"},{"depth":4,"slug":"returns-4","text":"Returns"},{"depth":4,"slug":"defined-in-7","text":"Defined in"},{"depth":3,"slug":"close","text":"close"},{"depth":4,"slug":"parameters-5","text":"Parameters"},{"depth":4,"slug":"returns-5","text":"Returns"},{"depth":4,"slug":"defined-in-8","text":"Defined in"},{"depth":3,"slug":"configure","text":"configure"},{"depth":4,"slug":"parameters-6","text":"Parameters"},{"depth":4,"slug":"returns-6","text":"Returns"},{"depth":4,"slug":"defined-in-9","text":"Defined in"},{"depth":3,"slug":"each","text":"each"},{"depth":4,"slug":"type-parameters-3","text":"Type parameters"},{"depth":4,"slug":"parameters-7","text":"Parameters"},{"depth":4,"slug":"returns-7","text":"Returns"},{"depth":4,"slug":"defined-in-10","text":"Defined in"},{"depth":4,"slug":"type-parameters-4","text":"Type parameters"},{"depth":4,"slug":"parameters-8","text":"Parameters"},{"depth":4,"slug":"returns-8","text":"Returns"},{"depth":4,"slug":"defined-in-11","text":"Defined in"},{"depth":3,"slug":"emit","text":"emit"},{"depth":4,"slug":"type-parameters-5","text":"Type parameters"},{"depth":4,"slug":"parameters-9","text":"Parameters"},{"depth":4,"slug":"returns-9","text":"Returns"},{"depth":4,"slug":"inherited-from-2","text":"Inherited from"},{"depth":4,"slug":"defined-in-12","text":"Defined in"},{"depth":3,"slug":"emitevent","text":"emitEvent"},{"depth":4,"slug":"parameters-10","text":"Parameters"},{"depth":4,"slug":"returns-10","text":"Returns"},{"depth":4,"slug":"defined-in-13","text":"Defined in"},{"depth":3,"slug":"eventnames","text":"eventNames"},{"depth":4,"slug":"returns-11","text":"Returns"},{"depth":4,"slug":"inherited-from-3","text":"Inherited from"},{"depth":4,"slug":"defined-in-14","text":"Defined in"},{"depth":3,"slug":"exec","text":"exec"},{"depth":4,"slug":"parameters-11","text":"Parameters"},{"depth":4,"slug":"returns-12","text":"Returns"},{"depth":4,"slug":"defined-in-15","text":"Defined in"},{"depth":3,"slug":"get","text":"get"},{"depth":4,"slug":"type-parameters-6","text":"Type parameters"},{"depth":4,"slug":"parameters-12","text":"Parameters"},{"depth":4,"slug":"returns-13","text":"Returns"},{"depth":4,"slug":"defined-in-16","text":"Defined in"},{"depth":4,"slug":"type-parameters-7","text":"Type parameters"},{"depth":4,"slug":"parameters-13","text":"Parameters"},{"depth":4,"slug":"returns-14","text":"Returns"},{"depth":4,"slug":"defined-in-17","text":"Defined in"},{"depth":3,"slug":"getconfiguration","text":"getConfiguration"},{"depth":4,"slug":"returns-15","text":"Returns"},{"depth":4,"slug":"defined-in-18","text":"Defined in"},{"depth":3,"slug":"getconnection","text":"getConnection"},{"depth":4,"slug":"parameters-14","text":"Parameters"},{"depth":4,"slug":"returns-16","text":"Returns"},{"depth":4,"slug":"defined-in-19","text":"Defined in"},{"depth":3,"slug":"handleerror","text":"handleError"},{"depth":4,"slug":"parameters-15","text":"Parameters"},{"depth":4,"slug":"returns-17","text":"Returns"},{"depth":4,"slug":"defined-in-20","text":"Defined in"},{"depth":3,"slug":"interrupt","text":"interrupt"},{"depth":4,"slug":"returns-18","text":"Returns"},{"depth":4,"slug":"defined-in-21","text":"Defined in"},{"depth":3,"slug":"listenercount","text":"listenerCount"},{"depth":4,"slug":"parameters-16","text":"Parameters"},{"depth":4,"slug":"returns-19","text":"Returns"},{"depth":4,"slug":"inherited-from-4","text":"Inherited from"},{"depth":4,"slug":"defined-in-22","text":"Defined in"},{"depth":3,"slug":"listeners","text":"listeners"},{"depth":4,"slug":"type-parameters-8","text":"Type parameters"},{"depth":4,"slug":"parameters-17","text":"Parameters"},{"depth":4,"slug":"returns-20","text":"Returns"},{"depth":4,"slug":"inherited-from-5","text":"Inherited from"},{"depth":4,"slug":"defined-in-23","text":"Defined in"},{"depth":3,"slug":"loadextension","text":"loadExtension"},{"depth":4,"slug":"parameters-18","text":"Parameters"},{"depth":4,"slug":"returns-21","text":"Returns"},{"depth":4,"slug":"defined-in-24","text":"Defined in"},{"depth":3,"slug":"off","text":"off"},{"depth":4,"slug":"type-parameters-9","text":"Type parameters"},{"depth":4,"slug":"parameters-19","text":"Parameters"},{"depth":4,"slug":"returns-22","text":"Returns"},{"depth":4,"slug":"inherited-from-6","text":"Inherited from"},{"depth":4,"slug":"defined-in-25","text":"Defined in"},{"depth":3,"slug":"on","text":"on"},{"depth":4,"slug":"type-parameters-10","text":"Type parameters"},{"depth":4,"slug":"parameters-20","text":"Parameters"},{"depth":4,"slug":"returns-23","text":"Returns"},{"depth":4,"slug":"inherited-from-7","text":"Inherited from"},{"depth":4,"slug":"defined-in-26","text":"Defined in"},{"depth":3,"slug":"once","text":"once"},{"depth":4,"slug":"type-parameters-11","text":"Type parameters"},{"depth":4,"slug":"parameters-21","text":"Parameters"},{"depth":4,"slug":"returns-24","text":"Returns"},{"depth":4,"slug":"inherited-from-8","text":"Inherited from"},{"depth":4,"slug":"defined-in-27","text":"Defined in"},{"depth":3,"slug":"prepare","text":"prepare"},{"depth":4,"slug":"type-parameters-12","text":"Type parameters"},{"depth":4,"slug":"parameters-22","text":"Parameters"},{"depth":4,"slug":"returns-25","text":"Returns"},{"depth":4,"slug":"defined-in-28","text":"Defined in"},{"depth":3,"slug":"processcontext","text":"processContext"},{"depth":4,"slug":"parameters-23","text":"Parameters"},{"depth":4,"slug":"returns-26","text":"Returns"},{"depth":4,"slug":"defined-in-29","text":"Defined in"},{"depth":3,"slug":"removealllisteners","text":"removeAllListeners"},{"depth":4,"slug":"parameters-24","text":"Parameters"},{"depth":4,"slug":"returns-27","text":"Returns"},{"depth":4,"slug":"inherited-from-9","text":"Inherited from"},{"depth":4,"slug":"defined-in-30","text":"Defined in"},{"depth":3,"slug":"removelistener","text":"removeListener"},{"depth":4,"slug":"type-parameters-13","text":"Type parameters"},{"depth":4,"slug":"parameters-25","text":"Parameters"},{"depth":4,"slug":"returns-28","text":"Returns"},{"depth":4,"slug":"inherited-from-10","text":"Inherited from"},{"depth":4,"slug":"defined-in-31","text":"Defined in"},{"depth":3,"slug":"run","text":"run"},{"depth":4,"slug":"type-parameters-14","text":"Type parameters"},{"depth":4,"slug":"parameters-26","text":"Parameters"},{"depth":4,"slug":"returns-29","text":"Returns"},{"depth":4,"slug":"defined-in-32","text":"Defined in"},{"depth":4,"slug":"type-parameters-15","text":"Type parameters"},{"depth":4,"slug":"parameters-27","text":"Parameters"},{"depth":4,"slug":"returns-30","text":"Returns"},{"depth":4,"slug":"defined-in-33","text":"Defined in"},{"depth":3,"slug":"sql","text":"sql"},{"depth":4,"slug":"parameters-28","text":"Parameters"},{"depth":4,"slug":"returns-31","text":"Returns"},{"depth":4,"slug":"defined-in-34","text":"Defined in"},{"depth":3,"slug":"verbose","text":"verbose"},{"depth":4,"slug":"returns-32","text":"Returns"},{"depth":4,"slug":"defined-in-35","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"Database","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLiteCloudConnection","filePath":"sqlite-cloud/sdks/js/classes/SQLiteCloudConnection","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/classes/sqlitecloudconnection","data":{"title":"SQLiteCloudConnection","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"Base class for SQLiteCloudConnection handles basics and defines methods.\nActual connection management and communication with the server in concrete classes.\n\n## Table of contents\n\n### Constructors\n\n- [constructor](sqlitecloudconnection#constructor)\n\n### Properties\n\n- [config](sqlitecloudconnection#config)\n- [operations](sqlitecloudconnection#operations)\n\n### Accessors\n\n- [connected](sqlitecloudconnection#connected)\n\n### Methods\n\n- [close](sqlitecloudconnection#close)\n- [connect](sqlitecloudconnection#connect)\n- [connectTransport](sqlitecloudconnection#connecttransport)\n- [log](sqlitecloudconnection#log)\n- [sendCommands](sqlitecloudconnection#sendcommands)\n- [transportCommands](sqlitecloudconnection#transportcommands)\n- [verbose](sqlitecloudconnection#verbose)\n\n## Constructors\n\n### constructor\n\n• **new SQLiteCloudConnection**(`config`, `callback?`): [`SQLiteCloudConnection`](sqlitecloudconnection)\n\nParse and validate provided connectionString or configuration\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `config` | `string` \\| [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig) |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n[`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Defined in\n\nsrc/drivers/connection.ts:16\n\n## Properties\n\n### config\n\n• `Protected` **config**: [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig)\n\nConfiguration passed by client or extracted from connection string\n\n#### Defined in\n\nsrc/drivers/connection.ts:28\n\n___\n\n### operations\n\n• `Protected` **operations**: `OperationsQueue`\n\nOperations are serialized by waiting an any pending promises\n\n#### Defined in\n\nsrc/drivers/connection.ts:31\n\n## Accessors\n\n### connected\n\n• `get` **connected**(): `boolean`\n\nReturns true if connection is open\n\n#### Returns\n\n`boolean`\n\n#### Defined in\n\nsrc/drivers/connection.ts:74\n\n## Methods\n\n### close\n\n▸ **close**(): [`SQLiteCloudConnection`](sqlitecloudconnection)\n\nDisconnect from server, release transport.\n\n#### Returns\n\n[`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Defined in\n\nsrc/drivers/connection.ts:100\n\n___\n\n### connect\n\n▸ **connect**(`callback?`): [`SQLiteCloudConnection`](sqlitecloudconnection)\n\nConnect will establish a tls or websocket transport to the server based on configuration and environment\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n[`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Defined in\n\nsrc/drivers/connection.ts:38\n\n___\n\n### connectTransport\n\n▸ **connectTransport**(`config`, `callback?`): [`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `config` | [`SQLiteCloudConfig`](../interfaces/sqlitecloudconfig) |\n| `callback?` | [`ErrorCallback`](../modules#errorcallback) |\n\n#### Returns\n\n[`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Defined in\n\nsrc/drivers/connection.ts:56\n\n___\n\n### log\n\n▸ **log**(`message`, `...optionalParams`): `void`\n\nWill log to console if verbose mode is enabled\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `message` | `string` |\n| `...optionalParams` | `any`[] |\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/connection.ts:62\n\n___\n\n### sendCommands\n\n▸ **sendCommands**(`commands`, `callback?`): [`SQLiteCloudConnection`](sqlitecloudconnection)\n\nWill enquee a command to be executed and callback with the resulting rowset/result/error\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `commands` | `string` |\n| `callback?` | `ResultsCallback`\\<`any`\\> |\n\n#### Returns\n\n[`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Defined in\n\nsrc/drivers/connection.ts:82\n\n___\n\n### transportCommands\n\n▸ **transportCommands**(`commands`, `callback?`): [`SQLiteCloudConnection`](sqlitecloudconnection)\n\nSend a command, return the rowset/result or throw an error\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `commands` | `string` |\n| `callback?` | `ResultsCallback`\\<`any`\\> |\n\n#### Returns\n\n[`SQLiteCloudConnection`](sqlitecloudconnection)\n\n#### Defined in\n\nsrc/drivers/connection.ts:59\n\n___\n\n### verbose\n\n▸ **verbose**(): `void`\n\nEnable verbose logging for debug purposes\n\n#### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/connection.ts:77","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/classes/SQLiteCloudConnection.md","digest":"bdec73975cd75480","rendered":{"html":"

    Base class for SQLiteCloudConnection handles basics and defines methods.\nActual connection management and communication with the server in concrete classes.

    \n

    Table of contents

    \n

    Constructors

    \n\n

    Properties

    \n\n

    Accessors

    \n\n

    Methods

    \n\n

    Constructors

    \n

    constructor

    \n

    new SQLiteCloudConnection(config, callback?): SQLiteCloudConnection

    \n

    Parse and validate provided connectionString or configuration

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    configstring | SQLiteCloudConfig
    callback?ErrorCallback
    \n

    Returns

    \n

    SQLiteCloudConnection

    \n

    Defined in

    \n

    src/drivers/connection.ts:16

    \n

    Properties

    \n

    config

    \n

    Protected config: SQLiteCloudConfig

    \n

    Configuration passed by client or extracted from connection string

    \n

    Defined in

    \n

    src/drivers/connection.ts:28

    \n
    \n

    operations

    \n

    Protected operations: OperationsQueue

    \n

    Operations are serialized by waiting an any pending promises

    \n

    Defined in

    \n

    src/drivers/connection.ts:31

    \n

    Accessors

    \n

    connected

    \n

    get connected(): boolean

    \n

    Returns true if connection is open

    \n

    Returns

    \n

    boolean

    \n

    Defined in

    \n

    src/drivers/connection.ts:74

    \n

    Methods

    \n

    close

    \n

    close(): SQLiteCloudConnection

    \n

    Disconnect from server, release transport.

    \n

    Returns

    \n

    SQLiteCloudConnection

    \n

    Defined in

    \n

    src/drivers/connection.ts:100

    \n
    \n

    connect

    \n

    connect(callback?): SQLiteCloudConnection

    \n

    Connect will establish a tls or websocket transport to the server based on configuration and environment

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callback?ErrorCallback
    \n

    Returns

    \n

    SQLiteCloudConnection

    \n

    Defined in

    \n

    src/drivers/connection.ts:38

    \n
    \n

    connectTransport

    \n

    connectTransport(config, callback?): SQLiteCloudConnection

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    configSQLiteCloudConfig
    callback?ErrorCallback
    \n

    Returns

    \n

    SQLiteCloudConnection

    \n

    Defined in

    \n

    src/drivers/connection.ts:56

    \n
    \n

    log

    \n

    log(message, ...optionalParams): void

    \n

    Will log to console if verbose mode is enabled

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    messagestring
    ...optionalParamsany[]
    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/connection.ts:62

    \n
    \n

    sendCommands

    \n

    sendCommands(commands, callback?): SQLiteCloudConnection

    \n

    Will enquee a command to be executed and callback with the resulting rowset/result/error

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    commandsstring
    callback?ResultsCallback&#x3C;any>
    \n

    Returns

    \n

    SQLiteCloudConnection

    \n

    Defined in

    \n

    src/drivers/connection.ts:82

    \n
    \n

    transportCommands

    \n

    transportCommands(commands, callback?): SQLiteCloudConnection

    \n

    Send a command, return the rowset/result or throw an error

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    commandsstring
    callback?ResultsCallback&#x3C;any>
    \n

    Returns

    \n

    SQLiteCloudConnection

    \n

    Defined in

    \n

    src/drivers/connection.ts:59

    \n
    \n

    verbose

    \n

    verbose(): void

    \n

    Enable verbose logging for debug purposes

    \n

    Returns

    \n

    void

    \n

    Defined in

    \n

    src/drivers/connection.ts:77

    ","metadata":{"headings":[{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"constructors","text":"Constructors"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":3,"slug":"accessors","text":"Accessors"},{"depth":3,"slug":"methods","text":"Methods"},{"depth":2,"slug":"constructors-1","text":"Constructors"},{"depth":3,"slug":"constructor","text":"constructor"},{"depth":4,"slug":"parameters","text":"Parameters"},{"depth":4,"slug":"returns","text":"Returns"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"config","text":"config"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"operations","text":"operations"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":2,"slug":"accessors-1","text":"Accessors"},{"depth":3,"slug":"connected","text":"connected"},{"depth":4,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":2,"slug":"methods-1","text":"Methods"},{"depth":3,"slug":"close","text":"close"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"defined-in-4","text":"Defined in"},{"depth":3,"slug":"connect","text":"connect"},{"depth":4,"slug":"parameters-1","text":"Parameters"},{"depth":4,"slug":"returns-3","text":"Returns"},{"depth":4,"slug":"defined-in-5","text":"Defined in"},{"depth":3,"slug":"connecttransport","text":"connectTransport"},{"depth":4,"slug":"parameters-2","text":"Parameters"},{"depth":4,"slug":"returns-4","text":"Returns"},{"depth":4,"slug":"defined-in-6","text":"Defined in"},{"depth":3,"slug":"log","text":"log"},{"depth":4,"slug":"parameters-3","text":"Parameters"},{"depth":4,"slug":"returns-5","text":"Returns"},{"depth":4,"slug":"defined-in-7","text":"Defined in"},{"depth":3,"slug":"sendcommands","text":"sendCommands"},{"depth":4,"slug":"parameters-4","text":"Parameters"},{"depth":4,"slug":"returns-6","text":"Returns"},{"depth":4,"slug":"defined-in-8","text":"Defined in"},{"depth":3,"slug":"transportcommands","text":"transportCommands"},{"depth":4,"slug":"parameters-5","text":"Parameters"},{"depth":4,"slug":"returns-7","text":"Returns"},{"depth":4,"slug":"defined-in-9","text":"Defined in"},{"depth":3,"slug":"verbose","text":"verbose"},{"depth":4,"slug":"returns-8","text":"Returns"},{"depth":4,"slug":"defined-in-10","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"SQLiteCloudConnection","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLiteCloudError","filePath":"sqlite-cloud/sdks/js/classes/SQLiteCloudError","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/classes/sqliteclouderror","data":{"title":"SQLiteCloudError","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"Custom error reported by SQLiteCloud drivers\n\n## Hierarchy\n\n- `Error`\n\n ↳ **`SQLiteCloudError`**\n\n## Table of contents\n\n### Constructors\n\n- [constructor](sqliteclouderror#constructor)\n\n### Properties\n\n- [cause](sqliteclouderror#cause)\n- [errorCode](sqliteclouderror#errorcode)\n- [externalErrorCode](sqliteclouderror#externalerrorcode)\n- [message](sqliteclouderror#message)\n- [name](sqliteclouderror#name)\n- [offsetCode](sqliteclouderror#offsetcode)\n- [stack](sqliteclouderror#stack)\n- [prepareStackTrace](sqliteclouderror#preparestacktrace)\n- [stackTraceLimit](sqliteclouderror#stacktracelimit)\n\n### Methods\n\n- [captureStackTrace](sqliteclouderror#capturestacktrace)\n\n## Constructors\n\n### constructor\n\n• **new SQLiteCloudError**(`message`, `args?`): [`SQLiteCloudError`](sqliteclouderror)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `message` | `string` |\n| `args?` | `Partial`\\<[`SQLiteCloudError`](sqliteclouderror)\\> |\n\n#### Returns\n\n[`SQLiteCloudError`](sqliteclouderror)\n\n#### Overrides\n\nError.constructor\n\n#### Defined in\n\nsrc/drivers/types.ts:102\n\n## Properties\n\n### cause\n\n• `Optional` **cause**: `string` \\| `Error`\n\nUpstream error that cause this error\n\n#### Overrides\n\nError.cause\n\n#### Defined in\n\nsrc/drivers/types.ts:111\n\n___\n\n### errorCode\n\n• `Optional` **errorCode**: `string`\n\nError code returned by drivers or server\n\n#### Defined in\n\nsrc/drivers/types.ts:113\n\n___\n\n### externalErrorCode\n\n• `Optional` **externalErrorCode**: `string`\n\nAdditional error code\n\n#### Defined in\n\nsrc/drivers/types.ts:115\n\n___\n\n### message\n\n• **message**: `string`\n\n#### Inherited from\n\nError.message\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1054\n\n___\n\n### name\n\n• **name**: `string`\n\n#### Inherited from\n\nError.name\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1053\n\n___\n\n### offsetCode\n\n• `Optional` **offsetCode**: `number`\n\nAdditional offset code in commands\n\n#### Defined in\n\nsrc/drivers/types.ts:117\n\n___\n\n### stack\n\n• `Optional` **stack**: `string`\n\n#### Inherited from\n\nError.stack\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1055\n\nnode_modules/@types/node/globals.d.ts:127\n\n___\n\n### prepareStackTrace\n\n▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`\n\n#### Type declaration\n\n▸ (`err`, `stackTraces`): `any`\n\nOptional override for formatting stack traces\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `err` | `Error` |\n| `stackTraces` | `CallSite`[] |\n\n##### Returns\n\n`any`\n\n**`See`**\n\nhttps://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces\n\n#### Inherited from\n\nError.prepareStackTrace\n\n#### Defined in\n\nnode_modules/@types/node/globals.d.ts:140\n\nnode_modules/bun-types/globals.d.ts:1532\n\n___\n\n### stackTraceLimit\n\n▪ `Static` **stackTraceLimit**: `number`\n\n#### Inherited from\n\nError.stackTraceLimit\n\n#### Defined in\n\nnode_modules/@types/node/globals.d.ts:142\n\nnode_modules/bun-types/globals.d.ts:1534\n\n## Methods\n\n### captureStackTrace\n\n▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`\n\nCreate .stack property on a target object\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `targetObject` | `Object` |\n| `constructorOpt?` | `Function` |\n\n#### Returns\n\n`void`\n\n#### Inherited from\n\nError.captureStackTrace\n\n#### Defined in\n\nnode_modules/@types/node/globals.d.ts:133\n\n▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`\n\nCreate .stack property on a target object\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `targetObject` | `object` |\n| `constructorOpt?` | `Function` |\n\n#### Returns\n\n`void`\n\n#### Inherited from\n\nError.captureStackTrace\n\n#### Defined in\n\nnode_modules/bun-types/globals.d.ts:1525","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/classes/SQLiteCloudError.md","digest":"5a2f9eb4b52da505","rendered":{"html":"

    Custom error reported by SQLiteCloud drivers

    \n

    Hierarchy

    \n
      \n
    • \n

      Error

      \n

      SQLiteCloudError

      \n
    • \n
    \n

    Table of contents

    \n

    Constructors

    \n\n

    Properties

    \n\n

    Methods

    \n\n

    Constructors

    \n

    constructor

    \n

    new SQLiteCloudError(message, args?): SQLiteCloudError

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    messagestring
    args?Partial&#x3C;SQLiteCloudError>
    \n

    Returns

    \n

    SQLiteCloudError

    \n

    Overrides

    \n

    Error.constructor

    \n

    Defined in

    \n

    src/drivers/types.ts:102

    \n

    Properties

    \n

    cause

    \n

    Optional cause: string | Error

    \n

    Upstream error that cause this error

    \n

    Overrides

    \n

    Error.cause

    \n

    Defined in

    \n

    src/drivers/types.ts:111

    \n
    \n

    errorCode

    \n

    Optional errorCode: string

    \n

    Error code returned by drivers or server

    \n

    Defined in

    \n

    src/drivers/types.ts:113

    \n
    \n

    externalErrorCode

    \n

    Optional externalErrorCode: string

    \n

    Additional error code

    \n

    Defined in

    \n

    src/drivers/types.ts:115

    \n
    \n

    message

    \n

    message: string

    \n

    Inherited from

    \n

    Error.message

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1054

    \n
    \n

    name

    \n

    name: string

    \n

    Inherited from

    \n

    Error.name

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1053

    \n
    \n

    offsetCode

    \n

    Optional offsetCode: number

    \n

    Additional offset code in commands

    \n

    Defined in

    \n

    src/drivers/types.ts:117

    \n
    \n

    stack

    \n

    Optional stack: string

    \n

    Inherited from

    \n

    Error.stack

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1055

    \n

    node_modules/@types/node/globals.d.ts:127

    \n
    \n

    prepareStackTrace

    \n

    Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

    \n

    Type declaration

    \n

    ▸ (err, stackTraces): any

    \n

    Optional override for formatting stack traces

    \n
    Parameters
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    errError
    stackTracesCallSite[]
    \n
    Returns
    \n

    any

    \n

    See

    \n

    https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

    \n

    Inherited from

    \n

    Error.prepareStackTrace

    \n

    Defined in

    \n

    node_modules/@types/node/globals.d.ts:140

    \n

    node_modules/bun-types/globals.d.ts:1532

    \n
    \n

    stackTraceLimit

    \n

    Static stackTraceLimit: number

    \n

    Inherited from

    \n

    Error.stackTraceLimit

    \n

    Defined in

    \n

    node_modules/@types/node/globals.d.ts:142

    \n

    node_modules/bun-types/globals.d.ts:1534

    \n

    Methods

    \n

    captureStackTrace

    \n

    captureStackTrace(targetObject, constructorOpt?): void

    \n

    Create .stack property on a target object

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    targetObjectObject
    constructorOpt?Function
    \n

    Returns

    \n

    void

    \n

    Inherited from

    \n

    Error.captureStackTrace

    \n

    Defined in

    \n

    node_modules/@types/node/globals.d.ts:133

    \n

    captureStackTrace(targetObject, constructorOpt?): void

    \n

    Create .stack property on a target object

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    targetObjectobject
    constructorOpt?Function
    \n

    Returns

    \n

    void

    \n

    Inherited from

    \n

    Error.captureStackTrace

    \n

    Defined in

    \n

    node_modules/bun-types/globals.d.ts:1525

    ","metadata":{"headings":[{"depth":2,"slug":"hierarchy","text":"Hierarchy"},{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"constructors","text":"Constructors"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":3,"slug":"methods","text":"Methods"},{"depth":2,"slug":"constructors-1","text":"Constructors"},{"depth":3,"slug":"constructor","text":"constructor"},{"depth":4,"slug":"parameters","text":"Parameters"},{"depth":4,"slug":"returns","text":"Returns"},{"depth":4,"slug":"overrides","text":"Overrides"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"cause","text":"cause"},{"depth":4,"slug":"overrides-1","text":"Overrides"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"errorcode","text":"errorCode"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"externalerrorcode","text":"externalErrorCode"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":3,"slug":"message","text":"message"},{"depth":4,"slug":"inherited-from","text":"Inherited from"},{"depth":4,"slug":"defined-in-4","text":"Defined in"},{"depth":3,"slug":"name","text":"name"},{"depth":4,"slug":"inherited-from-1","text":"Inherited from"},{"depth":4,"slug":"defined-in-5","text":"Defined in"},{"depth":3,"slug":"offsetcode","text":"offsetCode"},{"depth":4,"slug":"defined-in-6","text":"Defined in"},{"depth":3,"slug":"stack","text":"stack"},{"depth":4,"slug":"inherited-from-2","text":"Inherited from"},{"depth":4,"slug":"defined-in-7","text":"Defined in"},{"depth":3,"slug":"preparestacktrace","text":"prepareStackTrace"},{"depth":4,"slug":"type-declaration","text":"Type declaration"},{"depth":5,"slug":"parameters-1","text":"Parameters"},{"depth":5,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"inherited-from-3","text":"Inherited from"},{"depth":4,"slug":"defined-in-8","text":"Defined in"},{"depth":3,"slug":"stacktracelimit","text":"stackTraceLimit"},{"depth":4,"slug":"inherited-from-4","text":"Inherited from"},{"depth":4,"slug":"defined-in-9","text":"Defined in"},{"depth":2,"slug":"methods-1","text":"Methods"},{"depth":3,"slug":"capturestacktrace","text":"captureStackTrace"},{"depth":4,"slug":"parameters-2","text":"Parameters"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"inherited-from-5","text":"Inherited from"},{"depth":4,"slug":"defined-in-10","text":"Defined in"},{"depth":4,"slug":"parameters-3","text":"Parameters"},{"depth":4,"slug":"returns-3","text":"Returns"},{"depth":4,"slug":"inherited-from-6","text":"Inherited from"},{"depth":4,"slug":"defined-in-11","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"SQLiteCloudError","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLiteCloudRow","filePath":"sqlite-cloud/sdks/js/classes/SQLiteCloudRow","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/classes/sqlitecloudrow","data":{"title":"SQLiteCloudRow","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"A single row in a dataset with values accessible by column name\n\n## Indexable\n\n▪ [columnName: `string`]: `SQLiteCloudDataTypes`\n\nColumn values are accessed by column name\n\n## Table of contents\n\n### Constructors\n\n- [constructor](sqlitecloudrow#constructor)\n\n### Properties\n\n- [#data](sqlitecloudrow##data)\n- [#rowset](sqlitecloudrow##rowset)\n\n### Methods\n\n- [getData](sqlitecloudrow#getdata)\n- [getRowset](sqlitecloudrow#getrowset)\n\n## Constructors\n\n### constructor\n\n• **new SQLiteCloudRow**(`rowset`, `columnsNames`, `data`): [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `rowset` | [`SQLiteCloudRowset`](sqlitecloudrowset) |\n| `columnsNames` | `string`[] |\n| `data` | `SQLiteCloudDataTypes`[] |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Defined in\n\nsrc/drivers/rowset.ts:9\n\n## Properties\n\n### #data\n\n• `Private` **#data**: `SQLiteCloudDataTypes`[]\n\n#### Defined in\n\nsrc/drivers/rowset.ts:21\n\n___\n\n### #rowset\n\n• `Private` **#rowset**: [`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Defined in\n\nsrc/drivers/rowset.ts:18\n\n## Methods\n\n### getData\n\n▸ **getData**(): `SQLiteCloudDataTypes`[]\n\nReturns rowset data as a plain array of values\n\n#### Returns\n\n`SQLiteCloudDataTypes`[]\n\n#### Defined in\n\nsrc/drivers/rowset.ts:31\n\n___\n\n### getRowset\n\n▸ **getRowset**(): [`SQLiteCloudRowset`](sqlitecloudrowset)\n\nReturns the rowset that this row belongs to\n\n#### Returns\n\n[`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Defined in\n\nsrc/drivers/rowset.ts:25","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/classes/SQLiteCloudRow.md","digest":"a173f61e7cb83c3f","rendered":{"html":"

    A single row in a dataset with values accessible by column name

    \n

    Indexable

    \n

    ▪ [columnName: string]: SQLiteCloudDataTypes

    \n

    Column values are accessed by column name

    \n

    Table of contents

    \n

    Constructors

    \n\n

    Properties

    \n\n

    Methods

    \n\n

    Constructors

    \n

    constructor

    \n

    new SQLiteCloudRow(rowset, columnsNames, data): SQLiteCloudRow

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    rowsetSQLiteCloudRowset
    columnsNamesstring[]
    dataSQLiteCloudDataTypes[]
    \n

    Returns

    \n

    SQLiteCloudRow

    \n

    Defined in

    \n

    src/drivers/rowset.ts:9

    \n

    Properties

    \n

    #data

    \n

    Private #data: SQLiteCloudDataTypes[]

    \n

    Defined in

    \n

    src/drivers/rowset.ts:21

    \n
    \n

    #rowset

    \n

    Private #rowset: SQLiteCloudRowset

    \n

    Defined in

    \n

    src/drivers/rowset.ts:18

    \n

    Methods

    \n

    getData

    \n

    getData(): SQLiteCloudDataTypes[]

    \n

    Returns rowset data as a plain array of values

    \n

    Returns

    \n

    SQLiteCloudDataTypes[]

    \n

    Defined in

    \n

    src/drivers/rowset.ts:31

    \n
    \n

    getRowset

    \n

    getRowset(): SQLiteCloudRowset

    \n

    Returns the rowset that this row belongs to

    \n

    Returns

    \n

    SQLiteCloudRowset

    \n

    Defined in

    \n

    src/drivers/rowset.ts:25

    ","metadata":{"headings":[{"depth":2,"slug":"indexable","text":"Indexable"},{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"constructors","text":"Constructors"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":3,"slug":"methods","text":"Methods"},{"depth":2,"slug":"constructors-1","text":"Constructors"},{"depth":3,"slug":"constructor","text":"constructor"},{"depth":4,"slug":"parameters","text":"Parameters"},{"depth":4,"slug":"returns","text":"Returns"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"data","text":"#data"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"rowset","text":"#rowset"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":2,"slug":"methods-1","text":"Methods"},{"depth":3,"slug":"getdata","text":"getData"},{"depth":4,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":3,"slug":"getrowset","text":"getRowset"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"defined-in-4","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"SQLiteCloudRow","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLiteCloudRowset","filePath":"sqlite-cloud/sdks/js/classes/SQLiteCloudRowset","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/classes/sqlitecloudrowset","data":{"title":"SQLiteCloudRowset","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"## Hierarchy\n\n- `Array`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>\n\n ↳ **`SQLiteCloudRowset`**\n\n## Table of contents\n\n### Constructors\n\n- [constructor](sqlitecloudrowset#constructor)\n\n### Properties\n\n- [#data](sqlitecloudrowset##data)\n- [#metadata](sqlitecloudrowset##metadata)\n- [length](sqlitecloudrowset#length)\n- [[species]](sqlitecloudrowset#[species])\n\n### Accessors\n\n- [columnsNames](sqlitecloudrowset#columnsnames)\n- [metadata](sqlitecloudrowset#metadata)\n- [numberOfColumns](sqlitecloudrowset#numberofcolumns)\n- [numberOfRows](sqlitecloudrowset#numberofrows)\n- [version](sqlitecloudrowset#version)\n\n### Methods\n\n- [[iterator]](sqlitecloudrowset#[iterator])\n- [[unscopables]](sqlitecloudrowset#[unscopables])\n- [at](sqlitecloudrowset#at)\n- [concat](sqlitecloudrowset#concat)\n- [copyWithin](sqlitecloudrowset#copywithin)\n- [entries](sqlitecloudrowset#entries)\n- [every](sqlitecloudrowset#every)\n- [fill](sqlitecloudrowset#fill)\n- [filter](sqlitecloudrowset#filter)\n- [find](sqlitecloudrowset#find)\n- [findIndex](sqlitecloudrowset#findindex)\n- [flat](sqlitecloudrowset#flat)\n- [flatMap](sqlitecloudrowset#flatmap)\n- [forEach](sqlitecloudrowset#foreach)\n- [getItem](sqlitecloudrowset#getitem)\n- [includes](sqlitecloudrowset#includes)\n- [indexOf](sqlitecloudrowset#indexof)\n- [join](sqlitecloudrowset#join)\n- [keys](sqlitecloudrowset#keys)\n- [lastIndexOf](sqlitecloudrowset#lastindexof)\n- [map](sqlitecloudrowset#map)\n- [pop](sqlitecloudrowset#pop)\n- [push](sqlitecloudrowset#push)\n- [reduce](sqlitecloudrowset#reduce)\n- [reduceRight](sqlitecloudrowset#reduceright)\n- [reverse](sqlitecloudrowset#reverse)\n- [shift](sqlitecloudrowset#shift)\n- [slice](sqlitecloudrowset#slice)\n- [some](sqlitecloudrowset#some)\n- [sort](sqlitecloudrowset#sort)\n- [splice](sqlitecloudrowset#splice)\n- [toLocaleString](sqlitecloudrowset#tolocalestring)\n- [toString](sqlitecloudrowset#tostring)\n- [unshift](sqlitecloudrowset#unshift)\n- [values](sqlitecloudrowset#values)\n- [from](sqlitecloudrowset#from)\n- [fromAsync](sqlitecloudrowset#fromasync)\n- [isArray](sqlitecloudrowset#isarray)\n- [of](sqlitecloudrowset#of)\n\n## Constructors\n\n### constructor\n\n• **new SQLiteCloudRowset**(`metadata`, `data`): [`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `metadata` | [`SQLCloudRowsetMetadata`](../interfaces/sqlcloudrowsetmetadata) |\n| `data` | `any`[] |\n\n#### Returns\n\n[`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Overrides\n\nArray\\&lt;SQLiteCloudRow\\&gt;.constructor\n\n#### Defined in\n\nsrc/drivers/rowset.ts:41\n\n## Properties\n\n### #data\n\n• `Private` **#data**: `SQLiteCloudDataTypes`[]\n\nActual data organized in rows\n\n#### Defined in\n\nsrc/drivers/rowset.ts:72\n\n___\n\n### #metadata\n\n• `Private` **#metadata**: [`SQLCloudRowsetMetadata`](../interfaces/sqlcloudrowsetmetadata)\n\nMetadata contains number of rows and columns, column names, types, etc.\n\n#### Defined in\n\nsrc/drivers/rowset.ts:69\n\n___\n\n### length\n\n• **length**: `number`\n\nGets or sets the length of the array. This is a number one higher than the highest index in the array.\n\n#### Inherited from\n\nArray.length\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1304\n\n___\n\n### [species]\n\n▪ `Static` `Readonly` **[species]**: `ArrayConstructor`\n\n#### Inherited from\n\nArray.[species]\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:314\n\n## Accessors\n\n### columnsNames\n\n• `get` **columnsNames**(): `string`[]\n\nArray of columns names\n\n#### Returns\n\n`string`[]\n\n#### Defined in\n\nsrc/drivers/rowset.ts:93\n\n___\n\n### metadata\n\n• `get` **metadata**(): [`SQLCloudRowsetMetadata`](../interfaces/sqlcloudrowsetmetadata)\n\nGet rowset metadata\n\n#### Returns\n\n[`SQLCloudRowsetMetadata`](../interfaces/sqlcloudrowsetmetadata)\n\n#### Defined in\n\nsrc/drivers/rowset.ts:98\n\n___\n\n### numberOfColumns\n\n• `get` **numberOfColumns**(): `number`\n\nNumber of columns in row set\n\n#### Returns\n\n`number`\n\n#### Defined in\n\nsrc/drivers/rowset.ts:88\n\n___\n\n### numberOfRows\n\n• `get` **numberOfRows**(): `number`\n\nNumber of rows in row set\n\n#### Returns\n\n`number`\n\n#### Defined in\n\nsrc/drivers/rowset.ts:83\n\n___\n\n### version\n\n• `get` **version**(): `number`\n\nRowset version is 1 for a rowset with simple column names, 2 for extended metadata\n\n#### Returns\n\n`number`\n\n**`See`**\n\nhttps://github.com/sqlitecloud/sdk/blob/master/PROTOCOL.md\n\n#### Defined in\n\nsrc/drivers/rowset.ts:78\n\n## Methods\n\n### [iterator]\n\n▸ **[iterator]**(): `IterableIterator`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>\n\nIterator\n\n#### Returns\n\n`IterableIterator`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>\n\n#### Inherited from\n\nArray.[iterator]\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.iterable.d.ts:60\n\n___\n\n### [unscopables]\n\n▸ **[unscopables]**(): `Object`\n\nReturns an object whose properties have the value 'true'\nwhen they will be absent when used in a 'with' statement.\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------ | :------ |\n| `copyWithin` | `boolean` |\n| `entries` | `boolean` |\n| `fill` | `boolean` |\n| `find` | `boolean` |\n| `findIndex` | `boolean` |\n| `keys` | `boolean` |\n| `values` | `boolean` |\n\n#### Inherited from\n\nArray.[unscopables]\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:99\n\n___\n\n### at\n\n▸ **at**(`index`): `undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\nReturns the item located at the specified index.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `index` | `number` | The zero-based index of the desired code unit. A negative index will count back from the last item. |\n\n#### Returns\n\n`undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.at\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2022.array.d.ts:26\n\n___\n\n### concat\n\n▸ **concat**(`...items`): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nCombines two or more arrays.\nThis method returns a new array without modifying any existing arrays.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `...items` | `ConcatArray`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>[] | Additional arrays and/or items to add to the end of the array. |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\n#### Inherited from\n\nArray.concat\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1328\n\n▸ **concat**(`...items`): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nCombines two or more arrays.\nThis method returns a new array without modifying any existing arrays.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `...items` | ([`SQLiteCloudRow`](sqlitecloudrow) \\| `ConcatArray`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>)[] | Additional arrays and/or items to add to the end of the array. |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\n#### Inherited from\n\nArray.concat\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1334\n\n___\n\n### copyWithin\n\n▸ **copyWithin**(`target`, `start`, `end?`): [`SQLiteCloudRowset`](sqlitecloudrowset)\n\nReturns the this object after copying a section of the array identified by start and end\nto the same array starting at position target\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | `number` | If target is negative, it is treated as length+target where length is the length of the array. |\n| `start` | `number` | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. |\n| `end?` | `number` | If not specified, length of the this object is used as its default value. |\n\n#### Returns\n\n[`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Inherited from\n\nArray.copyWithin\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:64\n\n___\n\n### entries\n\n▸ **entries**(): `IterableIterator`\\<[`number`, [`SQLiteCloudRow`](sqlitecloudrow)]\\>\n\nReturns an iterable of key, value pairs for every entry in the array\n\n#### Returns\n\n`IterableIterator`\\<[`number`, [`SQLiteCloudRow`](sqlitecloudrow)]\\>\n\n#### Inherited from\n\nArray.entries\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.iterable.d.ts:65\n\n___\n\n### every\n\n▸ **every**\\<`S`\\>(`predicate`, `thisArg?`): this is S[]\n\nDetermines whether all the members of an array satisfy the specified test.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `S` | extends [`SQLiteCloudRow`](sqlitecloudrow)\\<`S`\\> |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `predicate` | (`value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => value is S | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. |\n| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |\n\n#### Returns\n\nthis is S[]\n\n#### Inherited from\n\nArray.every\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1411\n\n▸ **every**(`predicate`, `thisArg?`): `boolean`\n\nDetermines whether all the members of an array satisfy the specified test.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `predicate` | (`value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `unknown` | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. |\n| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |\n\n#### Returns\n\n`boolean`\n\n#### Inherited from\n\nArray.every\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1420\n\n___\n\n### fill\n\n▸ **fill**(`value`, `start?`, `end?`): [`SQLiteCloudRowset`](sqlitecloudrowset)\n\nChanges all array elements from `start` to `end` index to a static `value` and returns the modified array\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `value` | [`SQLiteCloudRow`](sqlitecloudrow) | value to fill array section with |\n| `start?` | `number` | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. |\n| `end?` | `number` | index to stop filling the array at. If end is negative, it is treated as length+end. |\n\n#### Returns\n\n[`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Inherited from\n\nArray.fill\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:53\n\n___\n\n### filter\n\n▸ **filter**(`fn`): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nReturns an instance of SQLiteCloudRowset where rows have been filtered via given callback\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `fn` | (`row`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `rowset`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `boolean` |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\n#### Overrides\n\nArray.filter\n\n#### Defined in\n\nsrc/drivers/rowset.ts:141\n\n___\n\n### find\n\n▸ **find**\\<`S`\\>(`predicate`, `thisArg?`): `undefined` \\| `S`\n\nReturns the value of the first element in the array where predicate is true, and undefined\notherwise.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `S` | extends [`SQLiteCloudRow`](sqlitecloudrow)\\<`S`\\> |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `predicate` | (`this`: `void`, `value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `obj`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => value is S | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. |\n| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |\n\n#### Returns\n\n`undefined` \\| `S`\n\n#### Inherited from\n\nArray.find\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:31\n\n▸ **find**(`predicate`, `thisArg?`): `undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `predicate` | (`value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `obj`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `unknown` |\n| `thisArg?` | `any` |\n\n#### Returns\n\n`undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.find\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:32\n\n___\n\n### findIndex\n\n▸ **findIndex**(`predicate`, `thisArg?`): `number`\n\nReturns the index of the first element in the array where predicate is true, and -1\notherwise.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `predicate` | (`value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `obj`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `unknown` | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. |\n| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |\n\n#### Returns\n\n`number`\n\n#### Inherited from\n\nArray.findIndex\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:43\n\n___\n\n### flat\n\n▸ **flat**\\<`A`, `D`\\>(`this`, `depth?`): `FlatArray`\\<`A`, `D`\\>[]\n\nReturns a new array with all sub-array elements concatenated into it recursively up to the\nspecified depth.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `A` | `A` |\n| `D` | extends `number` = ``1`` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `this` | `A` | - |\n| `depth?` | `D` | The maximum recursion depth |\n\n#### Returns\n\n`FlatArray`\\<`A`, `D`\\>[]\n\n#### Inherited from\n\nArray.flat\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2019.array.d.ts:81\n\n___\n\n### flatMap\n\n▸ **flatMap**\\<`U`, `This`\\>(`callback`, `thisArg?`): `U`[]\n\nCalls a defined callback function on each element of an array. Then, flattens the result into\na new array.\nThis is identical to a map followed by flat with depth 1.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `U` | `U` |\n| `This` | `undefined` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `callback` | (`this`: `This`, `value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `U` \\| readonly `U`[] | A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array. |\n| `thisArg?` | `This` | An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value. |\n\n#### Returns\n\n`U`[]\n\n#### Inherited from\n\nArray.flatMap\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2019.array.d.ts:70\n\n___\n\n### forEach\n\n▸ **forEach**(`callbackfn`, `thisArg?`): `void`\n\nPerforms the specified action for each element in an array.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `callbackfn` | (`value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `void` | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. |\n| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |\n\n#### Returns\n\n`void`\n\n#### Inherited from\n\nArray.forEach\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1435\n\n___\n\n### getItem\n\n▸ **getItem**(`row`, `column`): `any`\n\nReturn value of item at given row and column\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `row` | `number` |\n| `column` | `number` |\n\n#### Returns\n\n`any`\n\n#### Defined in\n\nsrc/drivers/rowset.ts:103\n\n___\n\n### includes\n\n▸ **includes**(`searchElement`, `fromIndex?`): `boolean`\n\nDetermines whether an array includes a certain element, returning true or false as appropriate.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `searchElement` | [`SQLiteCloudRow`](sqlitecloudrow) | The element to search for. |\n| `fromIndex?` | `number` | The position in this array at which to begin searching for searchElement. |\n\n#### Returns\n\n`boolean`\n\n#### Inherited from\n\nArray.includes\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2016.array.include.d.ts:27\n\n___\n\n### indexOf\n\n▸ **indexOf**(`searchElement`, `fromIndex?`): `number`\n\nReturns the index of the first occurrence of a value in an array, or -1 if it is not present.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `searchElement` | [`SQLiteCloudRow`](sqlitecloudrow) | The value to locate in the array. |\n| `fromIndex?` | `number` | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. |\n\n#### Returns\n\n`number`\n\n#### Inherited from\n\nArray.indexOf\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1396\n\n___\n\n### join\n\n▸ **join**(`separator?`): `string`\n\nAdds all the elements of an array into a string, separated by the specified separator string.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `separator?` | `string` | A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma. |\n\n#### Returns\n\n`string`\n\n#### Inherited from\n\nArray.join\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1339\n\n___\n\n### keys\n\n▸ **keys**(): `IterableIterator`\\<`number`\\>\n\nReturns an iterable of keys in the array\n\n#### Returns\n\n`IterableIterator`\\<`number`\\>\n\n#### Inherited from\n\nArray.keys\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.iterable.d.ts:70\n\n___\n\n### lastIndexOf\n\n▸ **lastIndexOf**(`searchElement`, `fromIndex?`): `number`\n\nReturns the index of the last occurrence of a specified value in an array, or -1 if it is not present.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `searchElement` | [`SQLiteCloudRow`](sqlitecloudrow) | The value to locate in the array. |\n| `fromIndex?` | `number` | The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array. |\n\n#### Returns\n\n`number`\n\n#### Inherited from\n\nArray.lastIndexOf\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1402\n\n___\n\n### map\n\n▸ **map**(`fn`): `any`[]\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `fn` | (`row`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `rowset`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `any` |\n\n#### Returns\n\n`any`[]\n\n#### Overrides\n\nArray.map\n\n#### Defined in\n\nsrc/drivers/rowset.ts:131\n\n___\n\n### pop\n\n▸ **pop**(): `undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\nRemoves the last element from an array and returns it.\nIf the array is empty, undefined is returned and the array is not modified.\n\n#### Returns\n\n`undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.pop\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1317\n\n___\n\n### push\n\n▸ **push**(`...items`): `number`\n\nAppends new elements to the end of an array, and returns the new length of the array.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `...items` | [`SQLiteCloudRow`](sqlitecloudrow)[] | New elements to add to the array. |\n\n#### Returns\n\n`number`\n\n#### Inherited from\n\nArray.push\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1322\n\n___\n\n### reduce\n\n▸ **reduce**(`callbackfn`): [`SQLiteCloudRow`](sqlitecloudrow)\n\nCalls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `callbackfn` | (`previousValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentIndex`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => [`SQLiteCloudRow`](sqlitecloudrow) | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.reduce\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1459\n\n▸ **reduce**(`callbackfn`, `initialValue`): [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callbackfn` | (`previousValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentIndex`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => [`SQLiteCloudRow`](sqlitecloudrow) |\n| `initialValue` | [`SQLiteCloudRow`](sqlitecloudrow) |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.reduce\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1460\n\n▸ **reduce**\\<`U`\\>(`callbackfn`, `initialValue`): `U`\n\nCalls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `U` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `callbackfn` | (`previousValue`: `U`, `currentValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentIndex`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `U` | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. |\n| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |\n\n#### Returns\n\n`U`\n\n#### Inherited from\n\nArray.reduce\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1466\n\n___\n\n### reduceRight\n\n▸ **reduceRight**(`callbackfn`): [`SQLiteCloudRow`](sqlitecloudrow)\n\nCalls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `callbackfn` | (`previousValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentIndex`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => [`SQLiteCloudRow`](sqlitecloudrow) | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.reduceRight\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1472\n\n▸ **reduceRight**(`callbackfn`, `initialValue`): [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callbackfn` | (`previousValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentIndex`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => [`SQLiteCloudRow`](sqlitecloudrow) |\n| `initialValue` | [`SQLiteCloudRow`](sqlitecloudrow) |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.reduceRight\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1473\n\n▸ **reduceRight**\\<`U`\\>(`callbackfn`, `initialValue`): `U`\n\nCalls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `U` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `callbackfn` | (`previousValue`: `U`, `currentValue`: [`SQLiteCloudRow`](sqlitecloudrow), `currentIndex`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `U` | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. |\n| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |\n\n#### Returns\n\n`U`\n\n#### Inherited from\n\nArray.reduceRight\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1479\n\n___\n\n### reverse\n\n▸ **reverse**(): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nReverses the elements in an array in place.\nThis method mutates the array and returns a reference to the same array.\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\n#### Inherited from\n\nArray.reverse\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1344\n\n___\n\n### shift\n\n▸ **shift**(): `undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\nRemoves the first element from an array and returns it.\nIf the array is empty, undefined is returned and the array is not modified.\n\n#### Returns\n\n`undefined` \\| [`SQLiteCloudRow`](sqlitecloudrow)\n\n#### Inherited from\n\nArray.shift\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1349\n\n___\n\n### slice\n\n▸ **slice**(`start?`, `end?`): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nReturns a subset of rows from this rowset\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `start?` | `number` |\n| `end?` | `number` |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\n#### Overrides\n\nArray.slice\n\n#### Defined in\n\nsrc/drivers/rowset.ts:113\n\n___\n\n### some\n\n▸ **some**(`predicate`, `thisArg?`): `boolean`\n\nDetermines whether the specified callback function returns true for any element of an array.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `predicate` | (`value`: [`SQLiteCloudRow`](sqlitecloudrow), `index`: `number`, `array`: [`SQLiteCloudRow`](sqlitecloudrow)[]) => `unknown` | A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. |\n| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |\n\n#### Returns\n\n`boolean`\n\n#### Inherited from\n\nArray.some\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1429\n\n___\n\n### sort\n\n▸ **sort**(`compareFn?`): [`SQLiteCloudRowset`](sqlitecloudrowset)\n\nSorts an array in place.\nThis method mutates the array and returns a reference to the same array.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `compareFn?` | (`a`: [`SQLiteCloudRow`](sqlitecloudrow), `b`: [`SQLiteCloudRow`](sqlitecloudrow)) => `number` | Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` |\n\n#### Returns\n\n[`SQLiteCloudRowset`](sqlitecloudrowset)\n\n#### Inherited from\n\nArray.sort\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1370\n\n___\n\n### splice\n\n▸ **splice**(`start`, `deleteCount?`): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nRemoves elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `start` | `number` | The zero-based location in the array from which to start removing elements. |\n| `deleteCount?` | `number` | The number of elements to remove. |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\nAn array containing the elements that were deleted.\n\n#### Inherited from\n\nArray.splice\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1377\n\n▸ **splice**(`start`, `deleteCount`, `...items`): [`SQLiteCloudRow`](sqlitecloudrow)[]\n\nRemoves elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `start` | `number` | The zero-based location in the array from which to start removing elements. |\n| `deleteCount` | `number` | The number of elements to remove. |\n| `...items` | [`SQLiteCloudRow`](sqlitecloudrow)[] | Elements to insert into the array in place of the deleted elements. |\n\n#### Returns\n\n[`SQLiteCloudRow`](sqlitecloudrow)[]\n\nAn array containing the elements that were deleted.\n\n#### Inherited from\n\nArray.splice\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1385\n\n___\n\n### toLocaleString\n\n▸ **toLocaleString**(): `string`\n\nReturns a string representation of an array. The elements are converted to string using their toLocaleString methods.\n\n#### Returns\n\n`string`\n\n#### Inherited from\n\nArray.toLocaleString\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1312\n\n___\n\n### toString\n\n▸ **toString**(): `string`\n\nReturns a string representation of an array.\n\n#### Returns\n\n`string`\n\n#### Inherited from\n\nArray.toString\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1308\n\n___\n\n### unshift\n\n▸ **unshift**(`...items`): `number`\n\nInserts new elements at the start of an array, and returns the new length of the array.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `...items` | [`SQLiteCloudRow`](sqlitecloudrow)[] | Elements to insert at the start of the array. |\n\n#### Returns\n\n`number`\n\n#### Inherited from\n\nArray.unshift\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1390\n\n___\n\n### values\n\n▸ **values**(): `IterableIterator`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>\n\nReturns an iterable of values in the array\n\n#### Returns\n\n`IterableIterator`\\<[`SQLiteCloudRow`](sqlitecloudrow)\\>\n\n#### Inherited from\n\nArray.values\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.iterable.d.ts:75\n\n___\n\n### from\n\n▸ **from**\\<`T`\\>(`arrayLike`): `T`[]\n\nCreates an array from an array-like object.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `arrayLike` | `ArrayLike`\\<`T`\\> | An array-like object to convert to an array. |\n\n#### Returns\n\n`T`[]\n\n#### Inherited from\n\nArray.from\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:72\n\n▸ **from**\\<`T`, `U`\\>(`arrayLike`, `mapfn`, `thisArg?`): `U`[]\n\nCreates an array from an iterable object.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n| `U` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `arrayLike` | `ArrayLike`\\<`T`\\> | An array-like object to convert to an array. |\n| `mapfn` | (`v`: `T`, `k`: `number`) => `U` | A mapping function to call on every element of the array. |\n| `thisArg?` | `any` | Value of 'this' used to invoke the mapfn. |\n\n#### Returns\n\n`U`[]\n\n#### Inherited from\n\nArray.from\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:80\n\n▸ **from**\\<`T`\\>(`iterable`): `T`[]\n\nCreates an array from an iterable object.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `iterable` | `Iterable`\\<`T`\\> \\| `ArrayLike`\\<`T`\\> | An iterable object to convert to an array. |\n\n#### Returns\n\n`T`[]\n\n#### Inherited from\n\nArray.from\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.iterable.d.ts:83\n\n▸ **from**\\<`T`, `U`\\>(`iterable`, `mapfn`, `thisArg?`): `U`[]\n\nCreates an array from an iterable object.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n| `U` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `iterable` | `Iterable`\\<`T`\\> \\| `ArrayLike`\\<`T`\\> | An iterable object to convert to an array. |\n| `mapfn` | (`v`: `T`, `k`: `number`) => `U` | A mapping function to call on every element of the array. |\n| `thisArg?` | `any` | Value of 'this' used to invoke the mapfn. |\n\n#### Returns\n\n`U`[]\n\n#### Inherited from\n\nArray.from\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.iterable.d.ts:91\n\n___\n\n### fromAsync\n\n▸ **fromAsync**\\<`T`\\>(`arrayLike`): `Promise`\\<`Awaited`\\<`T`\\>[]\\>\n\nCreate an array from an iterable or async iterable object.\nValues from the iterable are awaited.\n\n```ts\nawait Array.fromAsync([1]); // [1]\nawait Array.fromAsync([Promise.resolve(1)]); // [1]\nawait Array.fromAsync((async function*() { yield 1 })()); // [1]\n```\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `arrayLike` | `AsyncIterable`\\<`T`\\> \\| `Iterable`\\<`T`\\> \\| `ArrayLike`\\<`T`\\> | The iterable or async iterable to convert to an array. |\n\n#### Returns\n\n`Promise`\\<`Awaited`\\<`T`\\>[]\\>\n\nA Promise whose fulfillment is a new Array instance containing the values from the iterator.\n\n#### Inherited from\n\nArray.fromAsync\n\n#### Defined in\n\nnode_modules/bun-types/globals.d.ts:1579\n\n▸ **fromAsync**\\<`T`, `U`\\>(`arrayLike`, `mapFn?`, `thisArg?`): `Promise`\\<`Awaited`\\<`U`\\>[]\\>\n\nCreate an array from an iterable or async iterable object.\nValues from the iterable are awaited. Results of the map function are also awaited.\n\n```ts\nawait Array.fromAsync([1]); // [1]\nawait Array.fromAsync([Promise.resolve(1)]); // [1]\nawait Array.fromAsync((async function*() { yield 1 })()); // [1]\nawait Array.fromAsync([1], (n) => n + 1); // [2]\nawait Array.fromAsync([1], (n) => Promise.resolve(n + 1)); // [2]\n```\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n| `U` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `arrayLike` | `AsyncIterable`\\<`T`\\> \\| `Iterable`\\<`T`\\> \\| `ArrayLike`\\<`T`\\> | The iterable or async iterable to convert to an array. |\n| `mapFn?` | (`value`: `T`, `index`: `number`) => `U` | A mapper function that transforms each element of `arrayLike` after awaiting them. |\n| `thisArg?` | `any` | The `this` to which `mapFn` is bound. |\n\n#### Returns\n\n`Promise`\\<`Awaited`\\<`U`\\>[]\\>\n\nA Promise whose fulfillment is a new Array instance containing the values from the iterator.\n\n#### Inherited from\n\nArray.fromAsync\n\n#### Defined in\n\nnode_modules/bun-types/globals.d.ts:1598\n\n___\n\n### isArray\n\n▸ **isArray**(`arg`): arg is any[]\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `arg` | `any` |\n\n#### Returns\n\narg is any[]\n\n#### Inherited from\n\nArray.isArray\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es5.d.ts:1491\n\n___\n\n### of\n\n▸ **of**\\<`T`\\>(`...items`): `T`[]\n\nReturns a new array from a set of elements.\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `...items` | `T`[] | A set of elements to include in the new array object. |\n\n#### Returns\n\n`T`[]\n\n#### Inherited from\n\nArray.of\n\n#### Defined in\n\nnode_modules/typescript/lib/lib.es2015.core.d.ts:86","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/classes/SQLiteCloudRowset.md","digest":"7c2f887b211aaa75","rendered":{"html":"

    Hierarchy

    \n\n

    Table of contents

    \n

    Constructors

    \n\n

    Properties

    \n\n

    Accessors

    \n\n

    Methods

    \n\n

    Constructors

    \n

    constructor

    \n

    new SQLiteCloudRowset(metadata, data): SQLiteCloudRowset

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    metadataSQLCloudRowsetMetadata
    dataany[]
    \n

    Returns

    \n

    SQLiteCloudRowset

    \n

    Overrides

    \n

    Array&#x26;lt;SQLiteCloudRow&#x26;gt;.constructor

    \n

    Defined in

    \n

    src/drivers/rowset.ts:41

    \n

    Properties

    \n

    #data

    \n

    Private #data: SQLiteCloudDataTypes[]

    \n

    Actual data organized in rows

    \n

    Defined in

    \n

    src/drivers/rowset.ts:72

    \n
    \n

    #metadata

    \n

    Private #metadata: SQLCloudRowsetMetadata

    \n

    Metadata contains number of rows and columns, column names, types, etc.

    \n

    Defined in

    \n

    src/drivers/rowset.ts:69

    \n
    \n

    length

    \n

    length: number

    \n

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    \n

    Inherited from

    \n

    Array.length

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1304

    \n
    \n

    [species]

    \n

    Static Readonly [species]: ArrayConstructor

    \n

    Inherited from

    \n

    Array.[species]

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:314

    \n

    Accessors

    \n

    columnsNames

    \n

    get columnsNames(): string[]

    \n

    Array of columns names

    \n

    Returns

    \n

    string[]

    \n

    Defined in

    \n

    src/drivers/rowset.ts:93

    \n
    \n

    metadata

    \n

    get metadata(): SQLCloudRowsetMetadata

    \n

    Get rowset metadata

    \n

    Returns

    \n

    SQLCloudRowsetMetadata

    \n

    Defined in

    \n

    src/drivers/rowset.ts:98

    \n
    \n

    numberOfColumns

    \n

    get numberOfColumns(): number

    \n

    Number of columns in row set

    \n

    Returns

    \n

    number

    \n

    Defined in

    \n

    src/drivers/rowset.ts:88

    \n
    \n

    numberOfRows

    \n

    get numberOfRows(): number

    \n

    Number of rows in row set

    \n

    Returns

    \n

    number

    \n

    Defined in

    \n

    src/drivers/rowset.ts:83

    \n
    \n

    version

    \n

    get version(): number

    \n

    Rowset version is 1 for a rowset with simple column names, 2 for extended metadata

    \n

    Returns

    \n

    number

    \n

    See

    \n

    https://github.com/sqlitecloud/sdk/blob/master/PROTOCOL.md

    \n

    Defined in

    \n

    src/drivers/rowset.ts:78

    \n

    Methods

    \n

    [iterator]

    \n

    [iterator](): IterableIterator&#x3C;SQLiteCloudRow>

    \n

    Iterator

    \n

    Returns

    \n

    IterableIterator&#x3C;SQLiteCloudRow>

    \n

    Inherited from

    \n

    Array.[iterator]

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.iterable.d.ts:60

    \n
    \n

    [unscopables]

    \n

    [unscopables](): Object

    \n

    Returns an object whose properties have the value ‘true’\nwhen they will be absent when used in a ‘with’ statement.

    \n

    Returns

    \n

    Object

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    copyWithinboolean
    entriesboolean
    fillboolean
    findboolean
    findIndexboolean
    keysboolean
    valuesboolean
    \n

    Inherited from

    \n

    Array.[unscopables]

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:99

    \n
    \n

    at

    \n

    at(index): undefined | SQLiteCloudRow

    \n

    Returns the item located at the specified index.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    indexnumberThe zero-based index of the desired code unit. A negative index will count back from the last item.
    \n

    Returns

    \n

    undefined | SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.at

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2022.array.d.ts:26

    \n
    \n

    concat

    \n

    concat(...items): SQLiteCloudRow[]

    \n

    Combines two or more arrays.\nThis method returns a new array without modifying any existing arrays.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    ...itemsConcatArray&#x3C;SQLiteCloudRow>[]Additional arrays and/or items to add to the end of the array.
    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    Inherited from

    \n

    Array.concat

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1328

    \n

    concat(...items): SQLiteCloudRow[]

    \n

    Combines two or more arrays.\nThis method returns a new array without modifying any existing arrays.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    ...items(SQLiteCloudRow | ConcatArray&#x3C;SQLiteCloudRow>)[]Additional arrays and/or items to add to the end of the array.
    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    Inherited from

    \n

    Array.concat

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1334

    \n
    \n

    copyWithin

    \n

    copyWithin(target, start, end?): SQLiteCloudRowset

    \n

    Returns the this object after copying a section of the array identified by start and end\nto the same array starting at position target

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    targetnumberIf target is negative, it is treated as length+target where length is the length of the array.
    startnumberIf start is negative, it is treated as length+start. If end is negative, it is treated as length+end.
    end?numberIf not specified, length of the this object is used as its default value.
    \n

    Returns

    \n

    SQLiteCloudRowset

    \n

    Inherited from

    \n

    Array.copyWithin

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:64

    \n
    \n

    entries

    \n

    entries(): IterableIterator&#x3C;[number, SQLiteCloudRow]>

    \n

    Returns an iterable of key, value pairs for every entry in the array

    \n

    Returns

    \n

    IterableIterator&#x3C;[number, SQLiteCloudRow]>

    \n

    Inherited from

    \n

    Array.entries

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.iterable.d.ts:65

    \n
    \n

    every

    \n

    every&#x3C;S>(predicate, thisArg?): this is S[]

    \n

    Determines whether all the members of an array satisfy the specified test.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Sextends SQLiteCloudRow&#x3C;S>
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    predicate(value: SQLiteCloudRow, index: number, array: SQLiteCloudRow[]) => value is SA function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
    thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
    \n

    Returns

    \n

    this is S[]

    \n

    Inherited from

    \n

    Array.every

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1411

    \n

    every(predicate, thisArg?): boolean

    \n

    Determines whether all the members of an array satisfy the specified test.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    predicate(value: SQLiteCloudRow, index: number, array: SQLiteCloudRow[]) => unknownA function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
    thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
    \n

    Returns

    \n

    boolean

    \n

    Inherited from

    \n

    Array.every

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1420

    \n
    \n

    fill

    \n

    fill(value, start?, end?): SQLiteCloudRowset

    \n

    Changes all array elements from start to end index to a static value and returns the modified array

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    valueSQLiteCloudRowvalue to fill array section with
    start?numberindex to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.
    end?numberindex to stop filling the array at. If end is negative, it is treated as length+end.
    \n

    Returns

    \n

    SQLiteCloudRowset

    \n

    Inherited from

    \n

    Array.fill

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:53

    \n
    \n

    filter

    \n

    filter(fn): SQLiteCloudRow[]

    \n

    Returns an instance of SQLiteCloudRowset where rows have been filtered via given callback

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    fn(row: SQLiteCloudRow, index: number, rowset: SQLiteCloudRow[]) => boolean
    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    Overrides

    \n

    Array.filter

    \n

    Defined in

    \n

    src/drivers/rowset.ts:141

    \n
    \n

    find

    \n

    find&#x3C;S>(predicate, thisArg?): undefined | S

    \n

    Returns the value of the first element in the array where predicate is true, and undefined\notherwise.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    Sextends SQLiteCloudRow&#x3C;S>
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    predicate(this: void, value: SQLiteCloudRow, index: number, obj: SQLiteCloudRow[]) => value is Sfind calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.
    thisArg?anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
    \n

    Returns

    \n

    undefined | S

    \n

    Inherited from

    \n

    Array.find

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:31

    \n

    find(predicate, thisArg?): undefined | SQLiteCloudRow

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    predicate(value: SQLiteCloudRow, index: number, obj: SQLiteCloudRow[]) => unknown
    thisArg?any
    \n

    Returns

    \n

    undefined | SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.find

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:32

    \n
    \n

    findIndex

    \n

    findIndex(predicate, thisArg?): number

    \n

    Returns the index of the first element in the array where predicate is true, and -1\notherwise.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    predicate(value: SQLiteCloudRow, index: number, obj: SQLiteCloudRow[]) => unknownfind calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.
    thisArg?anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
    \n

    Returns

    \n

    number

    \n

    Inherited from

    \n

    Array.findIndex

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:43

    \n
    \n

    flat

    \n

    flat&#x3C;A, D>(this, depth?): FlatArray&#x3C;A, D>[]

    \n

    Returns a new array with all sub-array elements concatenated into it recursively up to the\nspecified depth.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    AA
    Dextends number = 1
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    thisA-
    depth?DThe maximum recursion depth
    \n

    Returns

    \n

    FlatArray&#x3C;A, D>[]

    \n

    Inherited from

    \n

    Array.flat

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2019.array.d.ts:81

    \n
    \n

    flatMap

    \n

    flatMap&#x3C;U, This>(callback, thisArg?): U[]

    \n

    Calls a defined callback function on each element of an array. Then, flattens the result into\na new array.\nThis is identical to a map followed by flat with depth 1.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    UU
    Thisundefined
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    callback(this: This, value: SQLiteCloudRow, index: number, array: SQLiteCloudRow[]) => U | readonly U[]A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.
    thisArg?ThisAn object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.
    \n

    Returns

    \n

    U[]

    \n

    Inherited from

    \n

    Array.flatMap

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2019.array.d.ts:70

    \n
    \n

    forEach

    \n

    forEach(callbackfn, thisArg?): void

    \n

    Performs the specified action for each element in an array.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    callbackfn(value: SQLiteCloudRow, index: number, array: SQLiteCloudRow[]) => voidA function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
    thisArg?anyAn object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
    \n

    Returns

    \n

    void

    \n

    Inherited from

    \n

    Array.forEach

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1435

    \n
    \n

    getItem

    \n

    getItem(row, column): any

    \n

    Return value of item at given row and column

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    rownumber
    columnnumber
    \n

    Returns

    \n

    any

    \n

    Defined in

    \n

    src/drivers/rowset.ts:103

    \n
    \n

    includes

    \n

    includes(searchElement, fromIndex?): boolean

    \n

    Determines whether an array includes a certain element, returning true or false as appropriate.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    searchElementSQLiteCloudRowThe element to search for.
    fromIndex?numberThe position in this array at which to begin searching for searchElement.
    \n

    Returns

    \n

    boolean

    \n

    Inherited from

    \n

    Array.includes

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2016.array.include.d.ts:27

    \n
    \n

    indexOf

    \n

    indexOf(searchElement, fromIndex?): number

    \n

    Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    searchElementSQLiteCloudRowThe value to locate in the array.
    fromIndex?numberThe array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
    \n

    Returns

    \n

    number

    \n

    Inherited from

    \n

    Array.indexOf

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1396

    \n
    \n

    join

    \n

    join(separator?): string

    \n

    Adds all the elements of an array into a string, separated by the specified separator string.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    separator?stringA string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
    \n

    Returns

    \n

    string

    \n

    Inherited from

    \n

    Array.join

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1339

    \n
    \n

    keys

    \n

    keys(): IterableIterator&#x3C;number>

    \n

    Returns an iterable of keys in the array

    \n

    Returns

    \n

    IterableIterator&#x3C;number>

    \n

    Inherited from

    \n

    Array.keys

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.iterable.d.ts:70

    \n
    \n

    lastIndexOf

    \n

    lastIndexOf(searchElement, fromIndex?): number

    \n

    Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    searchElementSQLiteCloudRowThe value to locate in the array.
    fromIndex?numberThe array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.
    \n

    Returns

    \n

    number

    \n

    Inherited from

    \n

    Array.lastIndexOf

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1402

    \n
    \n

    map

    \n

    map(fn): any[]

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    fn(row: SQLiteCloudRow, index: number, rowset: SQLiteCloudRow[]) => any
    \n

    Returns

    \n

    any[]

    \n

    Overrides

    \n

    Array.map

    \n

    Defined in

    \n

    src/drivers/rowset.ts:131

    \n
    \n

    pop

    \n

    pop(): undefined | SQLiteCloudRow

    \n

    Removes the last element from an array and returns it.\nIf the array is empty, undefined is returned and the array is not modified.

    \n

    Returns

    \n

    undefined | SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.pop

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1317

    \n
    \n

    push

    \n

    push(...items): number

    \n

    Appends new elements to the end of an array, and returns the new length of the array.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    ...itemsSQLiteCloudRow[]New elements to add to the array.
    \n

    Returns

    \n

    number

    \n

    Inherited from

    \n

    Array.push

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1322

    \n
    \n

    reduce

    \n

    reduce(callbackfn): SQLiteCloudRow

    \n

    Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    callbackfn(previousValue: SQLiteCloudRow, currentValue: SQLiteCloudRow, currentIndex: number, array: SQLiteCloudRow[]) => SQLiteCloudRowA function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
    \n

    Returns

    \n

    SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.reduce

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1459

    \n

    reduce(callbackfn, initialValue): SQLiteCloudRow

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callbackfn(previousValue: SQLiteCloudRow, currentValue: SQLiteCloudRow, currentIndex: number, array: SQLiteCloudRow[]) => SQLiteCloudRow
    initialValueSQLiteCloudRow
    \n

    Returns

    \n

    SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.reduce

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1460

    \n

    reduce&#x3C;U>(callbackfn, initialValue): U

    \n

    Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    U
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    callbackfn(previousValue: U, currentValue: SQLiteCloudRow, currentIndex: number, array: SQLiteCloudRow[]) => UA function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
    initialValueUIf initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
    \n

    Returns

    \n

    U

    \n

    Inherited from

    \n

    Array.reduce

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1466

    \n
    \n

    reduceRight

    \n

    reduceRight(callbackfn): SQLiteCloudRow

    \n

    Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    callbackfn(previousValue: SQLiteCloudRow, currentValue: SQLiteCloudRow, currentIndex: number, array: SQLiteCloudRow[]) => SQLiteCloudRowA function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
    \n

    Returns

    \n

    SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.reduceRight

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1472

    \n

    reduceRight(callbackfn, initialValue): SQLiteCloudRow

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callbackfn(previousValue: SQLiteCloudRow, currentValue: SQLiteCloudRow, currentIndex: number, array: SQLiteCloudRow[]) => SQLiteCloudRow
    initialValueSQLiteCloudRow
    \n

    Returns

    \n

    SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.reduceRight

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1473

    \n

    reduceRight&#x3C;U>(callbackfn, initialValue): U

    \n

    Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    U
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    callbackfn(previousValue: U, currentValue: SQLiteCloudRow, currentIndex: number, array: SQLiteCloudRow[]) => UA function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
    initialValueUIf initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
    \n

    Returns

    \n

    U

    \n

    Inherited from

    \n

    Array.reduceRight

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1479

    \n
    \n

    reverse

    \n

    reverse(): SQLiteCloudRow[]

    \n

    Reverses the elements in an array in place.\nThis method mutates the array and returns a reference to the same array.

    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    Inherited from

    \n

    Array.reverse

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1344

    \n
    \n

    shift

    \n

    shift(): undefined | SQLiteCloudRow

    \n

    Removes the first element from an array and returns it.\nIf the array is empty, undefined is returned and the array is not modified.

    \n

    Returns

    \n

    undefined | SQLiteCloudRow

    \n

    Inherited from

    \n

    Array.shift

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1349

    \n
    \n

    slice

    \n

    slice(start?, end?): SQLiteCloudRow[]

    \n

    Returns a subset of rows from this rowset

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    start?number
    end?number
    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    Overrides

    \n

    Array.slice

    \n

    Defined in

    \n

    src/drivers/rowset.ts:113

    \n
    \n

    some

    \n

    some(predicate, thisArg?): boolean

    \n

    Determines whether the specified callback function returns true for any element of an array.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    predicate(value: SQLiteCloudRow, index: number, array: SQLiteCloudRow[]) => unknownA function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.
    thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
    \n

    Returns

    \n

    boolean

    \n

    Inherited from

    \n

    Array.some

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1429

    \n
    \n

    sort

    \n

    sort(compareFn?): SQLiteCloudRowset

    \n

    Sorts an array in place.\nThis method mutates the array and returns a reference to the same array.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    compareFn?(a: SQLiteCloudRow, b: SQLiteCloudRow) => numberFunction used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they’re equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ts [11,2,22,1].sort((a, b) => a - b)
    \n

    Returns

    \n

    SQLiteCloudRowset

    \n

    Inherited from

    \n

    Array.sort

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1370

    \n
    \n

    splice

    \n

    splice(start, deleteCount?): SQLiteCloudRow[]

    \n

    Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    startnumberThe zero-based location in the array from which to start removing elements.
    deleteCount?numberThe number of elements to remove.
    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    An array containing the elements that were deleted.

    \n

    Inherited from

    \n

    Array.splice

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1377

    \n

    splice(start, deleteCount, ...items): SQLiteCloudRow[]

    \n

    Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    startnumberThe zero-based location in the array from which to start removing elements.
    deleteCountnumberThe number of elements to remove.
    ...itemsSQLiteCloudRow[]Elements to insert into the array in place of the deleted elements.
    \n

    Returns

    \n

    SQLiteCloudRow[]

    \n

    An array containing the elements that were deleted.

    \n

    Inherited from

    \n

    Array.splice

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1385

    \n
    \n

    toLocaleString

    \n

    toLocaleString(): string

    \n

    Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

    \n

    Returns

    \n

    string

    \n

    Inherited from

    \n

    Array.toLocaleString

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1312

    \n
    \n

    toString

    \n

    toString(): string

    \n

    Returns a string representation of an array.

    \n

    Returns

    \n

    string

    \n

    Inherited from

    \n

    Array.toString

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1308

    \n
    \n

    unshift

    \n

    unshift(...items): number

    \n

    Inserts new elements at the start of an array, and returns the new length of the array.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    ...itemsSQLiteCloudRow[]Elements to insert at the start of the array.
    \n

    Returns

    \n

    number

    \n

    Inherited from

    \n

    Array.unshift

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1390

    \n
    \n

    values

    \n

    values(): IterableIterator&#x3C;SQLiteCloudRow>

    \n

    Returns an iterable of values in the array

    \n

    Returns

    \n

    IterableIterator&#x3C;SQLiteCloudRow>

    \n

    Inherited from

    \n

    Array.values

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.iterable.d.ts:75

    \n
    \n

    from

    \n

    from&#x3C;T>(arrayLike): T[]

    \n

    Creates an array from an array-like object.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    arrayLikeArrayLike&#x3C;T>An array-like object to convert to an array.
    \n

    Returns

    \n

    T[]

    \n

    Inherited from

    \n

    Array.from

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:72

    \n

    from&#x3C;T, U>(arrayLike, mapfn, thisArg?): U[]

    \n

    Creates an array from an iterable object.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    U
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    arrayLikeArrayLike&#x3C;T>An array-like object to convert to an array.
    mapfn(v: T, k: number) => UA mapping function to call on every element of the array.
    thisArg?anyValue of ‘this’ used to invoke the mapfn.
    \n

    Returns

    \n

    U[]

    \n

    Inherited from

    \n

    Array.from

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:80

    \n

    from&#x3C;T>(iterable): T[]

    \n

    Creates an array from an iterable object.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    iterableIterable&#x3C;T> | ArrayLike&#x3C;T>An iterable object to convert to an array.
    \n

    Returns

    \n

    T[]

    \n

    Inherited from

    \n

    Array.from

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.iterable.d.ts:83

    \n

    from&#x3C;T, U>(iterable, mapfn, thisArg?): U[]

    \n

    Creates an array from an iterable object.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    U
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    iterableIterable&#x3C;T> | ArrayLike&#x3C;T>An iterable object to convert to an array.
    mapfn(v: T, k: number) => UA mapping function to call on every element of the array.
    thisArg?anyValue of ‘this’ used to invoke the mapfn.
    \n

    Returns

    \n

    U[]

    \n

    Inherited from

    \n

    Array.from

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.iterable.d.ts:91

    \n
    \n

    fromAsync

    \n

    fromAsync&#x3C;T>(arrayLike): Promise&#x3C;Awaited&#x3C;T>[]>

    \n

    Create an array from an iterable or async iterable object.\nValues from the iterable are awaited.

    \n
    await Array.fromAsync([1]); // [1]\nawait Array.fromAsync([Promise.resolve(1)]); // [1]\nawait Array.fromAsync((async function*() { yield 1 })()); // [1]
    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    arrayLikeAsyncIterable&#x3C;T> | Iterable&#x3C;T> | ArrayLike&#x3C;T>The iterable or async iterable to convert to an array.
    \n

    Returns

    \n

    Promise&#x3C;Awaited&#x3C;T>[]>

    \n

    A Promise whose fulfillment is a new Array instance containing the values from the iterator.

    \n

    Inherited from

    \n

    Array.fromAsync

    \n

    Defined in

    \n

    node_modules/bun-types/globals.d.ts:1579

    \n

    fromAsync&#x3C;T, U>(arrayLike, mapFn?, thisArg?): Promise&#x3C;Awaited&#x3C;U>[]>

    \n

    Create an array from an iterable or async iterable object.\nValues from the iterable are awaited. Results of the map function are also awaited.

    \n
    await Array.fromAsync([1]); // [1]\nawait Array.fromAsync([Promise.resolve(1)]); // [1]\nawait Array.fromAsync((async function*() { yield 1 })()); // [1]\nawait Array.fromAsync([1], (n) => n + 1); // [2]\nawait Array.fromAsync([1], (n) => Promise.resolve(n + 1)); // [2]
    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    U
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    arrayLikeAsyncIterable&#x3C;T> | Iterable&#x3C;T> | ArrayLike&#x3C;T>The iterable or async iterable to convert to an array.
    mapFn?(value: T, index: number) => UA mapper function that transforms each element of arrayLike after awaiting them.
    thisArg?anyThe this to which mapFn is bound.
    \n

    Returns

    \n

    Promise&#x3C;Awaited&#x3C;U>[]>

    \n

    A Promise whose fulfillment is a new Array instance containing the values from the iterator.

    \n

    Inherited from

    \n

    Array.fromAsync

    \n

    Defined in

    \n

    node_modules/bun-types/globals.d.ts:1598

    \n
    \n

    isArray

    \n

    isArray(arg): arg is any[]

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    argany
    \n

    Returns

    \n

    arg is any[]

    \n

    Inherited from

    \n

    Array.isArray

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es5.d.ts:1491

    \n
    \n

    of

    \n

    of&#x3C;T>(...items): T[]

    \n

    Returns a new array from a set of elements.

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameTypeDescription
    ...itemsT[]A set of elements to include in the new array object.
    \n

    Returns

    \n

    T[]

    \n

    Inherited from

    \n

    Array.of

    \n

    Defined in

    \n

    node_modules/typescript/lib/lib.es2015.core.d.ts:86

    ","metadata":{"headings":[{"depth":2,"slug":"hierarchy","text":"Hierarchy"},{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"constructors","text":"Constructors"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":3,"slug":"accessors","text":"Accessors"},{"depth":3,"slug":"methods","text":"Methods"},{"depth":2,"slug":"constructors-1","text":"Constructors"},{"depth":3,"slug":"constructor","text":"constructor"},{"depth":4,"slug":"parameters","text":"Parameters"},{"depth":4,"slug":"returns","text":"Returns"},{"depth":4,"slug":"overrides","text":"Overrides"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"data","text":"#data"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"metadata","text":"#metadata"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"length","text":"length"},{"depth":4,"slug":"inherited-from","text":"Inherited from"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":3,"slug":"species","text":"[species]"},{"depth":4,"slug":"inherited-from-1","text":"Inherited from"},{"depth":4,"slug":"defined-in-4","text":"Defined in"},{"depth":2,"slug":"accessors-1","text":"Accessors"},{"depth":3,"slug":"columnsnames","text":"columnsNames"},{"depth":4,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"defined-in-5","text":"Defined in"},{"depth":3,"slug":"metadata-1","text":"metadata"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"defined-in-6","text":"Defined in"},{"depth":3,"slug":"numberofcolumns","text":"numberOfColumns"},{"depth":4,"slug":"returns-3","text":"Returns"},{"depth":4,"slug":"defined-in-7","text":"Defined in"},{"depth":3,"slug":"numberofrows","text":"numberOfRows"},{"depth":4,"slug":"returns-4","text":"Returns"},{"depth":4,"slug":"defined-in-8","text":"Defined in"},{"depth":3,"slug":"version","text":"version"},{"depth":4,"slug":"returns-5","text":"Returns"},{"depth":4,"slug":"defined-in-9","text":"Defined in"},{"depth":2,"slug":"methods-1","text":"Methods"},{"depth":3,"slug":"iterator","text":"[iterator]"},{"depth":4,"slug":"returns-6","text":"Returns"},{"depth":4,"slug":"inherited-from-2","text":"Inherited from"},{"depth":4,"slug":"defined-in-10","text":"Defined in"},{"depth":3,"slug":"unscopables","text":"[unscopables]"},{"depth":4,"slug":"returns-7","text":"Returns"},{"depth":4,"slug":"inherited-from-3","text":"Inherited from"},{"depth":4,"slug":"defined-in-11","text":"Defined in"},{"depth":3,"slug":"at","text":"at"},{"depth":4,"slug":"parameters-1","text":"Parameters"},{"depth":4,"slug":"returns-8","text":"Returns"},{"depth":4,"slug":"inherited-from-4","text":"Inherited from"},{"depth":4,"slug":"defined-in-12","text":"Defined in"},{"depth":3,"slug":"concat","text":"concat"},{"depth":4,"slug":"parameters-2","text":"Parameters"},{"depth":4,"slug":"returns-9","text":"Returns"},{"depth":4,"slug":"inherited-from-5","text":"Inherited from"},{"depth":4,"slug":"defined-in-13","text":"Defined in"},{"depth":4,"slug":"parameters-3","text":"Parameters"},{"depth":4,"slug":"returns-10","text":"Returns"},{"depth":4,"slug":"inherited-from-6","text":"Inherited from"},{"depth":4,"slug":"defined-in-14","text":"Defined in"},{"depth":3,"slug":"copywithin","text":"copyWithin"},{"depth":4,"slug":"parameters-4","text":"Parameters"},{"depth":4,"slug":"returns-11","text":"Returns"},{"depth":4,"slug":"inherited-from-7","text":"Inherited from"},{"depth":4,"slug":"defined-in-15","text":"Defined in"},{"depth":3,"slug":"entries","text":"entries"},{"depth":4,"slug":"returns-12","text":"Returns"},{"depth":4,"slug":"inherited-from-8","text":"Inherited from"},{"depth":4,"slug":"defined-in-16","text":"Defined in"},{"depth":3,"slug":"every","text":"every"},{"depth":4,"slug":"type-parameters","text":"Type parameters"},{"depth":4,"slug":"parameters-5","text":"Parameters"},{"depth":4,"slug":"returns-13","text":"Returns"},{"depth":4,"slug":"inherited-from-9","text":"Inherited from"},{"depth":4,"slug":"defined-in-17","text":"Defined in"},{"depth":4,"slug":"parameters-6","text":"Parameters"},{"depth":4,"slug":"returns-14","text":"Returns"},{"depth":4,"slug":"inherited-from-10","text":"Inherited from"},{"depth":4,"slug":"defined-in-18","text":"Defined in"},{"depth":3,"slug":"fill","text":"fill"},{"depth":4,"slug":"parameters-7","text":"Parameters"},{"depth":4,"slug":"returns-15","text":"Returns"},{"depth":4,"slug":"inherited-from-11","text":"Inherited from"},{"depth":4,"slug":"defined-in-19","text":"Defined in"},{"depth":3,"slug":"filter","text":"filter"},{"depth":4,"slug":"parameters-8","text":"Parameters"},{"depth":4,"slug":"returns-16","text":"Returns"},{"depth":4,"slug":"overrides-1","text":"Overrides"},{"depth":4,"slug":"defined-in-20","text":"Defined in"},{"depth":3,"slug":"find","text":"find"},{"depth":4,"slug":"type-parameters-1","text":"Type parameters"},{"depth":4,"slug":"parameters-9","text":"Parameters"},{"depth":4,"slug":"returns-17","text":"Returns"},{"depth":4,"slug":"inherited-from-12","text":"Inherited from"},{"depth":4,"slug":"defined-in-21","text":"Defined in"},{"depth":4,"slug":"parameters-10","text":"Parameters"},{"depth":4,"slug":"returns-18","text":"Returns"},{"depth":4,"slug":"inherited-from-13","text":"Inherited from"},{"depth":4,"slug":"defined-in-22","text":"Defined in"},{"depth":3,"slug":"findindex","text":"findIndex"},{"depth":4,"slug":"parameters-11","text":"Parameters"},{"depth":4,"slug":"returns-19","text":"Returns"},{"depth":4,"slug":"inherited-from-14","text":"Inherited from"},{"depth":4,"slug":"defined-in-23","text":"Defined in"},{"depth":3,"slug":"flat","text":"flat"},{"depth":4,"slug":"type-parameters-2","text":"Type parameters"},{"depth":4,"slug":"parameters-12","text":"Parameters"},{"depth":4,"slug":"returns-20","text":"Returns"},{"depth":4,"slug":"inherited-from-15","text":"Inherited from"},{"depth":4,"slug":"defined-in-24","text":"Defined in"},{"depth":3,"slug":"flatmap","text":"flatMap"},{"depth":4,"slug":"type-parameters-3","text":"Type parameters"},{"depth":4,"slug":"parameters-13","text":"Parameters"},{"depth":4,"slug":"returns-21","text":"Returns"},{"depth":4,"slug":"inherited-from-16","text":"Inherited from"},{"depth":4,"slug":"defined-in-25","text":"Defined in"},{"depth":3,"slug":"foreach","text":"forEach"},{"depth":4,"slug":"parameters-14","text":"Parameters"},{"depth":4,"slug":"returns-22","text":"Returns"},{"depth":4,"slug":"inherited-from-17","text":"Inherited from"},{"depth":4,"slug":"defined-in-26","text":"Defined in"},{"depth":3,"slug":"getitem","text":"getItem"},{"depth":4,"slug":"parameters-15","text":"Parameters"},{"depth":4,"slug":"returns-23","text":"Returns"},{"depth":4,"slug":"defined-in-27","text":"Defined in"},{"depth":3,"slug":"includes","text":"includes"},{"depth":4,"slug":"parameters-16","text":"Parameters"},{"depth":4,"slug":"returns-24","text":"Returns"},{"depth":4,"slug":"inherited-from-18","text":"Inherited from"},{"depth":4,"slug":"defined-in-28","text":"Defined in"},{"depth":3,"slug":"indexof","text":"indexOf"},{"depth":4,"slug":"parameters-17","text":"Parameters"},{"depth":4,"slug":"returns-25","text":"Returns"},{"depth":4,"slug":"inherited-from-19","text":"Inherited from"},{"depth":4,"slug":"defined-in-29","text":"Defined in"},{"depth":3,"slug":"join","text":"join"},{"depth":4,"slug":"parameters-18","text":"Parameters"},{"depth":4,"slug":"returns-26","text":"Returns"},{"depth":4,"slug":"inherited-from-20","text":"Inherited from"},{"depth":4,"slug":"defined-in-30","text":"Defined in"},{"depth":3,"slug":"keys","text":"keys"},{"depth":4,"slug":"returns-27","text":"Returns"},{"depth":4,"slug":"inherited-from-21","text":"Inherited from"},{"depth":4,"slug":"defined-in-31","text":"Defined in"},{"depth":3,"slug":"lastindexof","text":"lastIndexOf"},{"depth":4,"slug":"parameters-19","text":"Parameters"},{"depth":4,"slug":"returns-28","text":"Returns"},{"depth":4,"slug":"inherited-from-22","text":"Inherited from"},{"depth":4,"slug":"defined-in-32","text":"Defined in"},{"depth":3,"slug":"map","text":"map"},{"depth":4,"slug":"parameters-20","text":"Parameters"},{"depth":4,"slug":"returns-29","text":"Returns"},{"depth":4,"slug":"overrides-2","text":"Overrides"},{"depth":4,"slug":"defined-in-33","text":"Defined in"},{"depth":3,"slug":"pop","text":"pop"},{"depth":4,"slug":"returns-30","text":"Returns"},{"depth":4,"slug":"inherited-from-23","text":"Inherited from"},{"depth":4,"slug":"defined-in-34","text":"Defined in"},{"depth":3,"slug":"push","text":"push"},{"depth":4,"slug":"parameters-21","text":"Parameters"},{"depth":4,"slug":"returns-31","text":"Returns"},{"depth":4,"slug":"inherited-from-24","text":"Inherited from"},{"depth":4,"slug":"defined-in-35","text":"Defined in"},{"depth":3,"slug":"reduce","text":"reduce"},{"depth":4,"slug":"parameters-22","text":"Parameters"},{"depth":4,"slug":"returns-32","text":"Returns"},{"depth":4,"slug":"inherited-from-25","text":"Inherited from"},{"depth":4,"slug":"defined-in-36","text":"Defined in"},{"depth":4,"slug":"parameters-23","text":"Parameters"},{"depth":4,"slug":"returns-33","text":"Returns"},{"depth":4,"slug":"inherited-from-26","text":"Inherited from"},{"depth":4,"slug":"defined-in-37","text":"Defined in"},{"depth":4,"slug":"type-parameters-4","text":"Type parameters"},{"depth":4,"slug":"parameters-24","text":"Parameters"},{"depth":4,"slug":"returns-34","text":"Returns"},{"depth":4,"slug":"inherited-from-27","text":"Inherited from"},{"depth":4,"slug":"defined-in-38","text":"Defined in"},{"depth":3,"slug":"reduceright","text":"reduceRight"},{"depth":4,"slug":"parameters-25","text":"Parameters"},{"depth":4,"slug":"returns-35","text":"Returns"},{"depth":4,"slug":"inherited-from-28","text":"Inherited from"},{"depth":4,"slug":"defined-in-39","text":"Defined in"},{"depth":4,"slug":"parameters-26","text":"Parameters"},{"depth":4,"slug":"returns-36","text":"Returns"},{"depth":4,"slug":"inherited-from-29","text":"Inherited from"},{"depth":4,"slug":"defined-in-40","text":"Defined in"},{"depth":4,"slug":"type-parameters-5","text":"Type parameters"},{"depth":4,"slug":"parameters-27","text":"Parameters"},{"depth":4,"slug":"returns-37","text":"Returns"},{"depth":4,"slug":"inherited-from-30","text":"Inherited from"},{"depth":4,"slug":"defined-in-41","text":"Defined in"},{"depth":3,"slug":"reverse","text":"reverse"},{"depth":4,"slug":"returns-38","text":"Returns"},{"depth":4,"slug":"inherited-from-31","text":"Inherited from"},{"depth":4,"slug":"defined-in-42","text":"Defined in"},{"depth":3,"slug":"shift","text":"shift"},{"depth":4,"slug":"returns-39","text":"Returns"},{"depth":4,"slug":"inherited-from-32","text":"Inherited from"},{"depth":4,"slug":"defined-in-43","text":"Defined in"},{"depth":3,"slug":"slice","text":"slice"},{"depth":4,"slug":"parameters-28","text":"Parameters"},{"depth":4,"slug":"returns-40","text":"Returns"},{"depth":4,"slug":"overrides-3","text":"Overrides"},{"depth":4,"slug":"defined-in-44","text":"Defined in"},{"depth":3,"slug":"some","text":"some"},{"depth":4,"slug":"parameters-29","text":"Parameters"},{"depth":4,"slug":"returns-41","text":"Returns"},{"depth":4,"slug":"inherited-from-33","text":"Inherited from"},{"depth":4,"slug":"defined-in-45","text":"Defined in"},{"depth":3,"slug":"sort","text":"sort"},{"depth":4,"slug":"parameters-30","text":"Parameters"},{"depth":4,"slug":"returns-42","text":"Returns"},{"depth":4,"slug":"inherited-from-34","text":"Inherited from"},{"depth":4,"slug":"defined-in-46","text":"Defined in"},{"depth":3,"slug":"splice","text":"splice"},{"depth":4,"slug":"parameters-31","text":"Parameters"},{"depth":4,"slug":"returns-43","text":"Returns"},{"depth":4,"slug":"inherited-from-35","text":"Inherited from"},{"depth":4,"slug":"defined-in-47","text":"Defined in"},{"depth":4,"slug":"parameters-32","text":"Parameters"},{"depth":4,"slug":"returns-44","text":"Returns"},{"depth":4,"slug":"inherited-from-36","text":"Inherited from"},{"depth":4,"slug":"defined-in-48","text":"Defined in"},{"depth":3,"slug":"tolocalestring","text":"toLocaleString"},{"depth":4,"slug":"returns-45","text":"Returns"},{"depth":4,"slug":"inherited-from-37","text":"Inherited from"},{"depth":4,"slug":"defined-in-49","text":"Defined in"},{"depth":3,"slug":"tostring","text":"toString"},{"depth":4,"slug":"returns-46","text":"Returns"},{"depth":4,"slug":"inherited-from-38","text":"Inherited from"},{"depth":4,"slug":"defined-in-50","text":"Defined in"},{"depth":3,"slug":"unshift","text":"unshift"},{"depth":4,"slug":"parameters-33","text":"Parameters"},{"depth":4,"slug":"returns-47","text":"Returns"},{"depth":4,"slug":"inherited-from-39","text":"Inherited from"},{"depth":4,"slug":"defined-in-51","text":"Defined in"},{"depth":3,"slug":"values","text":"values"},{"depth":4,"slug":"returns-48","text":"Returns"},{"depth":4,"slug":"inherited-from-40","text":"Inherited from"},{"depth":4,"slug":"defined-in-52","text":"Defined in"},{"depth":3,"slug":"from","text":"from"},{"depth":4,"slug":"type-parameters-6","text":"Type parameters"},{"depth":4,"slug":"parameters-34","text":"Parameters"},{"depth":4,"slug":"returns-49","text":"Returns"},{"depth":4,"slug":"inherited-from-41","text":"Inherited from"},{"depth":4,"slug":"defined-in-53","text":"Defined in"},{"depth":4,"slug":"type-parameters-7","text":"Type parameters"},{"depth":4,"slug":"parameters-35","text":"Parameters"},{"depth":4,"slug":"returns-50","text":"Returns"},{"depth":4,"slug":"inherited-from-42","text":"Inherited from"},{"depth":4,"slug":"defined-in-54","text":"Defined in"},{"depth":4,"slug":"type-parameters-8","text":"Type parameters"},{"depth":4,"slug":"parameters-36","text":"Parameters"},{"depth":4,"slug":"returns-51","text":"Returns"},{"depth":4,"slug":"inherited-from-43","text":"Inherited from"},{"depth":4,"slug":"defined-in-55","text":"Defined in"},{"depth":4,"slug":"type-parameters-9","text":"Type parameters"},{"depth":4,"slug":"parameters-37","text":"Parameters"},{"depth":4,"slug":"returns-52","text":"Returns"},{"depth":4,"slug":"inherited-from-44","text":"Inherited from"},{"depth":4,"slug":"defined-in-56","text":"Defined in"},{"depth":3,"slug":"fromasync","text":"fromAsync"},{"depth":4,"slug":"type-parameters-10","text":"Type parameters"},{"depth":4,"slug":"parameters-38","text":"Parameters"},{"depth":4,"slug":"returns-53","text":"Returns"},{"depth":4,"slug":"inherited-from-45","text":"Inherited from"},{"depth":4,"slug":"defined-in-57","text":"Defined in"},{"depth":4,"slug":"type-parameters-11","text":"Type parameters"},{"depth":4,"slug":"parameters-39","text":"Parameters"},{"depth":4,"slug":"returns-54","text":"Returns"},{"depth":4,"slug":"inherited-from-46","text":"Inherited from"},{"depth":4,"slug":"defined-in-58","text":"Defined in"},{"depth":3,"slug":"isarray","text":"isArray"},{"depth":4,"slug":"parameters-40","text":"Parameters"},{"depth":4,"slug":"returns-55","text":"Returns"},{"depth":4,"slug":"inherited-from-47","text":"Inherited from"},{"depth":4,"slug":"defined-in-59","text":"Defined in"},{"depth":3,"slug":"of","text":"of"},{"depth":4,"slug":"type-parameters-12","text":"Type parameters"},{"depth":4,"slug":"parameters-41","text":"Parameters"},{"depth":4,"slug":"returns-56","text":"Returns"},{"depth":4,"slug":"inherited-from-48","text":"Inherited from"},{"depth":4,"slug":"defined-in-60","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"SQLiteCloudRowset","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLiteCloudStatement","filePath":"sqlite-cloud/sdks/js/classes/Statement","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/classes/statement","data":{"title":"Statement ","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"A statement generated by Database.prepare used to prepare SQL with ? bindings\n\n## Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n## Table of contents\n\n### Constructors\n\n- [constructor](statement#constructor)\n\n### Properties\n\n- [\\_database](statement#_database)\n- [\\_preparedSql](statement#_preparedsql)\n- [\\_sql](statement#_sql)\n\n### Methods\n\n- [all](statement#all)\n- [bind](statement#bind)\n- [each](statement#each)\n- [get](statement#get)\n- [run](statement#run)\n\n## Constructors\n\n### constructor\n\n• **new Statement**\\<`T`\\>(`database`, `sql`, `...params`): [`Statement`](statement)\\<`T`\\>\n\n#### Type parameters\n\n| Name |\n| :------ |\n| `T` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `database` | [`Database`](database) |\n| `sql` | `string` |\n| `...params` | `any`[] |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:13\n\n## Properties\n\n### \\_database\n\n• `Private` **\\_database**: [`Database`](database)\n\nStatement belongs to this database\n\n#### Defined in\n\nsrc/drivers/statement.ts:25\n\n___\n\n### \\_preparedSql\n\n• `Private` `Optional` **\\_preparedSql**: `string`\n\nThe SQL statement with binding values applied\n\n#### Defined in\n\nsrc/drivers/statement.ts:31\n\n___\n\n### \\_sql\n\n• `Private` **\\_sql**: `string`\n\nThe SQL statement with ? binding placeholders\n\n#### Defined in\n\nsrc/drivers/statement.ts:28\n\n## Methods\n\n### all\n\n▸ **all**(`callback?`): [`Statement`](statement)\\<`T`\\>\n\nBinds parameters, executes the statement and calls the callback with\nall result rows. The function returns the Statement object to allow\nfor function chaining. The parameters are the same as the Statement#run function\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback?` | `RowsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:121\n\n▸ **all**(`params`, `callback?`): [`Statement`](statement)\\<`T`\\>\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `params` | `any` |\n| `callback?` | `RowsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:122\n\n___\n\n### bind\n\n▸ **bind**(`...params`): [`Statement`](statement)\\<`T`\\>\n\nBinds parameters to the prepared statement and calls the callback when done\nor when an error occurs. The function returns the Statement object to allow\nfor function chaining. The first and only argument to the callback is null\nwhen binding was successful, otherwise it is the error object. Binding parameters\nwith this function completely resets the statement object and row cursor and\nremoves all previously bound parameters, if any. Currently bound parameters\nare escaped client side and turned into literals before being executed on the server.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `...params` | `any`[] |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:42\n\n___\n\n### each\n\n▸ **each**(`callback?`, `complete?`): [`Statement`](statement)\\<`T`\\>\n\nBinds parameters, executes the statement and calls the callback for each result row.\nThe function returns the Statement object to allow for function chaining. Parameters\nare the same as the Database#each function.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback?` | `RowCallback`\\<`T`\\> |\n| `complete?` | `RowCountCallback` |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:147\n\n▸ **each**(`params`, `callback?`, `complete?`): [`Statement`](statement)\\<`T`\\>\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `params` | `any` |\n| `callback?` | `RowCallback`\\<`T`\\> |\n| `complete?` | `RowCountCallback` |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:148\n\n___\n\n### get\n\n▸ **get**(`callback?`): [`Statement`](statement)\\<`T`\\>\n\nBinds parameters, executes the statement and retrieves the first result row.\nThe function returns the Statement object to allow for function chaining.\nThe parameters are the same as the Statement#run function, with the following differences:\nThe signature of the callback is function(err, row) {}. If the result set is empty,\nthe second parameter is undefined, otherwise it is an object containing the values\n for the first row.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback?` | `RowCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:95\n\n▸ **get**(`params`, `callback?`): [`Statement`](statement)\\<`T`\\>\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `params` | `any` |\n| `callback?` | `RowCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:96\n\n___\n\n### run\n\n▸ **run**(`callback?`): [`Statement`](statement)\\<`T`\\>\n\nBinds parameters and executes the statement. The function returns the Statement object to\nallow for function chaining. If you specify bind parameters, they will be bound to the statement\nbefore it is executed. Note that the bindings and the row cursor are reset when you specify\neven a single bind parameter. The callback behavior is identical to the Database#run method\nwith the difference that the statement will not be finalized after it is run. This means you\ncan run it multiple times.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `callback?` | `ResultsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:66\n\n▸ **run**(`params`, `callback?`): [`Statement`](statement)\\<`T`\\>\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `params` | `any` |\n| `callback?` | `ResultsCallback`\\<`T`\\> |\n\n#### Returns\n\n[`Statement`](statement)\\<`T`\\>\n\n#### Defined in\n\nsrc/drivers/statement.ts:67","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/classes/Statement.md","digest":"55b938354ee25c35","rendered":{"html":"

    A statement generated by Database.prepare used to prepare SQL with ? bindings

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Table of contents

    \n

    Constructors

    \n\n

    Properties

    \n\n

    Methods

    \n\n

    Constructors

    \n

    constructor

    \n

    new Statement&#x3C;T>(database, sql, ...params): Statement&#x3C;T>

    \n

    Type parameters

    \n\n\n\n\n\n\n\n\n\n\n\n
    Name
    T
    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    databaseDatabase
    sqlstring
    ...paramsany[]
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:13

    \n

    Properties

    \n

    _database

    \n

    Private _database: Database

    \n

    Statement belongs to this database

    \n

    Defined in

    \n

    src/drivers/statement.ts:25

    \n
    \n

    _preparedSql

    \n

    Private Optional _preparedSql: string

    \n

    The SQL statement with binding values applied

    \n

    Defined in

    \n

    src/drivers/statement.ts:31

    \n
    \n

    _sql

    \n

    Private _sql: string

    \n

    The SQL statement with ? binding placeholders

    \n

    Defined in

    \n

    src/drivers/statement.ts:28

    \n

    Methods

    \n

    all

    \n

    all(callback?): Statement&#x3C;T>

    \n

    Binds parameters, executes the statement and calls the callback with\nall result rows. The function returns the Statement object to allow\nfor function chaining. The parameters are the same as the Statement#run function

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callback?RowsCallback&#x3C;T>
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:121

    \n

    all(params, callback?): Statement&#x3C;T>

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    paramsany
    callback?RowsCallback&#x3C;T>
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:122

    \n
    \n

    bind

    \n

    bind(...params): Statement&#x3C;T>

    \n

    Binds parameters to the prepared statement and calls the callback when done\nor when an error occurs. The function returns the Statement object to allow\nfor function chaining. The first and only argument to the callback is null\nwhen binding was successful, otherwise it is the error object. Binding parameters\nwith this function completely resets the statement object and row cursor and\nremoves all previously bound parameters, if any. Currently bound parameters\nare escaped client side and turned into literals before being executed on the server.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    ...paramsany[]
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:42

    \n
    \n

    each

    \n

    each(callback?, complete?): Statement&#x3C;T>

    \n

    Binds parameters, executes the statement and calls the callback for each result row.\nThe function returns the Statement object to allow for function chaining. Parameters\nare the same as the Database#each function.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callback?RowCallback&#x3C;T>
    complete?RowCountCallback
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:147

    \n

    each(params, callback?, complete?): Statement&#x3C;T>

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    paramsany
    callback?RowCallback&#x3C;T>
    complete?RowCountCallback
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:148

    \n
    \n

    get

    \n

    get(callback?): Statement&#x3C;T>

    \n

    Binds parameters, executes the statement and retrieves the first result row.\nThe function returns the Statement object to allow for function chaining.\nThe parameters are the same as the Statement#run function, with the following differences:\nThe signature of the callback is function(err, row) {}. If the result set is empty,\nthe second parameter is undefined, otherwise it is an object containing the values\nfor the first row.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callback?RowCallback&#x3C;T>
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:95

    \n

    get(params, callback?): Statement&#x3C;T>

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    paramsany
    callback?RowCallback&#x3C;T>
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:96

    \n
    \n

    run

    \n

    run(callback?): Statement&#x3C;T>

    \n

    Binds parameters and executes the statement. The function returns the Statement object to\nallow for function chaining. If you specify bind parameters, they will be bound to the statement\nbefore it is executed. Note that the bindings and the row cursor are reset when you specify\neven a single bind parameter. The callback behavior is identical to the Database#run method\nwith the difference that the statement will not be finalized after it is run. This means you\ncan run it multiple times.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    callback?ResultsCallback&#x3C;T>
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:66

    \n

    run(params, callback?): Statement&#x3C;T>

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    paramsany
    callback?ResultsCallback&#x3C;T>
    \n

    Returns

    \n

    Statement&#x3C;T>

    \n

    Defined in

    \n

    src/drivers/statement.ts:67

    ","metadata":{"headings":[{"depth":2,"slug":"type-parameters","text":"Type parameters"},{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"constructors","text":"Constructors"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":3,"slug":"methods","text":"Methods"},{"depth":2,"slug":"constructors-1","text":"Constructors"},{"depth":3,"slug":"constructor","text":"constructor"},{"depth":4,"slug":"type-parameters-1","text":"Type parameters"},{"depth":4,"slug":"parameters","text":"Parameters"},{"depth":4,"slug":"returns","text":"Returns"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"_database","text":"_database"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"_preparedsql","text":"_preparedSql"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"_sql","text":"_sql"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":2,"slug":"methods-1","text":"Methods"},{"depth":3,"slug":"all","text":"all"},{"depth":4,"slug":"parameters-1","text":"Parameters"},{"depth":4,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"defined-in-4","text":"Defined in"},{"depth":4,"slug":"parameters-2","text":"Parameters"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"defined-in-5","text":"Defined in"},{"depth":3,"slug":"bind","text":"bind"},{"depth":4,"slug":"parameters-3","text":"Parameters"},{"depth":4,"slug":"returns-3","text":"Returns"},{"depth":4,"slug":"defined-in-6","text":"Defined in"},{"depth":3,"slug":"each","text":"each"},{"depth":4,"slug":"parameters-4","text":"Parameters"},{"depth":4,"slug":"returns-4","text":"Returns"},{"depth":4,"slug":"defined-in-7","text":"Defined in"},{"depth":4,"slug":"parameters-5","text":"Parameters"},{"depth":4,"slug":"returns-5","text":"Returns"},{"depth":4,"slug":"defined-in-8","text":"Defined in"},{"depth":3,"slug":"get","text":"get"},{"depth":4,"slug":"parameters-6","text":"Parameters"},{"depth":4,"slug":"returns-6","text":"Returns"},{"depth":4,"slug":"defined-in-9","text":"Defined in"},{"depth":4,"slug":"parameters-7","text":"Parameters"},{"depth":4,"slug":"returns-7","text":"Returns"},{"depth":4,"slug":"defined-in-10","text":"Defined in"},{"depth":3,"slug":"run","text":"run"},{"depth":4,"slug":"parameters-8","text":"Parameters"},{"depth":4,"slug":"returns-8","text":"Returns"},{"depth":4,"slug":"defined-in-11","text":"Defined in"},{"depth":4,"slug":"parameters-9","text":"Parameters"},{"depth":4,"slug":"returns-9","text":"Returns"},{"depth":4,"slug":"defined-in-12","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"Statement ","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLCloudRowsetMetadata","filePath":"sqlite-cloud/sdks/js/interfaces/SQLCloudRowsetMetadata","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/interfaces/sqlcloudrowsetmetadata","data":{"title":"SQLCloudRowsetMetadata","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"Metadata information for a set of rows resulting from a query\n\n## Table of contents\n\n### Properties\n\n- [columns](sqlcloudrowsetmetadata#columns)\n- [numberOfColumns](sqlcloudrowsetmetadata#numberofcolumns)\n- [numberOfRows](sqlcloudrowsetmetadata#numberofrows)\n- [version](sqlcloudrowsetmetadata#version)\n\n## Properties\n\n### columns\n\n• **columns**: \\{ `autoIncrement?`: `number` ; `column?`: `string` ; `database?`: `string` ; `name`: `string` ; `notNull?`: `number` ; `primaryKey?`: `number` ; `table?`: `string` ; `type?`: `string` }[]\n\nColumns' metadata\n\n#### Defined in\n\nsrc/drivers/types.ts:77\n\n___\n\n### numberOfColumns\n\n• **numberOfColumns**: `number`\n\nNumber of columns\n\n#### Defined in\n\nsrc/drivers/types.ts:74\n\n___\n\n### numberOfRows\n\n• **numberOfRows**: `number`\n\nNumber of rows\n\n#### Defined in\n\nsrc/drivers/types.ts:72\n\n___\n\n### version\n\n• **version**: `number`\n\nRowset version 1 has column's name, version 2 has extended metadata\n\n#### Defined in\n\nsrc/drivers/types.ts:70","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/interfaces/SQLCloudRowsetMetadata.md","digest":"fb356102e7b38f99","rendered":{"html":"

    Metadata information for a set of rows resulting from a query

    \n

    Table of contents

    \n

    Properties

    \n\n

    Properties

    \n

    columns

    \n

    columns: { autoIncrement?: number ; column?: string ; database?: string ; name: string ; notNull?: number ; primaryKey?: number ; table?: string ; type?: string }[]

    \n

    Columns’ metadata

    \n

    Defined in

    \n

    src/drivers/types.ts:77

    \n
    \n

    numberOfColumns

    \n

    numberOfColumns: number

    \n

    Number of columns

    \n

    Defined in

    \n

    src/drivers/types.ts:74

    \n
    \n

    numberOfRows

    \n

    numberOfRows: number

    \n

    Number of rows

    \n

    Defined in

    \n

    src/drivers/types.ts:72

    \n
    \n

    version

    \n

    version: number

    \n

    Rowset version 1 has column’s name, version 2 has extended metadata

    \n

    Defined in

    \n

    src/drivers/types.ts:70

    ","metadata":{"headings":[{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"columns","text":"columns"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":3,"slug":"numberofcolumns","text":"numberOfColumns"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"numberofrows","text":"numberOfRows"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"version","text":"version"},{"depth":4,"slug":"defined-in-3","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"SQLCloudRowsetMetadata","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"SQLiteCloudConfig","filePath":"sqlite-cloud/sdks/js/interfaces/SQLiteCloudConfig","type":"inner","level":2,"entry":{"id":"sqlite-cloud/sdks/js/interfaces/sqlitecloudconfig","data":{"title":"SQLiteCloudConfig","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"Configuration for SQLite cloud connection\n\n## Table of contents\n\n### Properties\n\n- [clientId](sqlitecloudconfig#clientid)\n- [compression](sqlitecloudconfig#compression)\n- [connectionString](sqlitecloudconfig#connectionstring)\n- [createDatabase](sqlitecloudconfig#createdatabase)\n- [database](sqlitecloudconfig#database)\n- [dbMemory](sqlitecloudconfig#dbmemory)\n- [gatewayUrl](sqlitecloudconfig#gatewayurl)\n- [host](sqlitecloudconfig#host)\n- [insecure](sqlitecloudconfig#insecure)\n- [maxData](sqlitecloudconfig#maxdata)\n- [maxRows](sqlitecloudconfig#maxrows)\n- [maxRowset](sqlitecloudconfig#maxrowset)\n- [noBlob](sqlitecloudconfig#noblob)\n- [nonlinearizable](sqlitecloudconfig#nonlinearizable)\n- [password](sqlitecloudconfig#password)\n- [passwordHashed](sqlitecloudconfig#passwordhashed)\n- [port](sqlitecloudconfig#port)\n- [timeout](sqlitecloudconfig#timeout)\n- [tlsOptions](sqlitecloudconfig#tlsoptions)\n- [useWebsocket](sqlitecloudconfig#usewebsocket)\n- [username](sqlitecloudconfig#username)\n- [verbose](sqlitecloudconfig#verbose)\n\n## Properties\n\n### clientId\n\n• `Optional` **clientId**: `string`\n\nOptional identifier used for verbose logging\n\n#### Defined in\n\nsrc/drivers/types.ts:62\n\n___\n\n### compression\n\n• `Optional` **compression**: `boolean`\n\n#### Defined in\n\nsrc/drivers/types.ts:41\n\n___\n\n### connectionString\n\n• `Optional` **connectionString**: `string`\n\nConnection string in the form of sqlitecloud://user:password@host:port/database?options\n\n#### Defined in\n\nsrc/drivers/types.ts:15\n\n___\n\n### createDatabase\n\n• `Optional` **createDatabase**: `boolean`\n\nCreate the database if it doesn't exist?\n\n#### Defined in\n\nsrc/drivers/types.ts:37\n\n___\n\n### database\n\n• `Optional` **database**: `string`\n\nName of database to open\n\n#### Defined in\n\nsrc/drivers/types.ts:34\n\n___\n\n### dbMemory\n\n• `Optional` **dbMemory**: `boolean`\n\nDatabase will be created in memory\n\n#### Defined in\n\nsrc/drivers/types.ts:39\n\n___\n\n### gatewayUrl\n\n• `Optional` **gatewayUrl**: `string`\n\nUrl where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:4000\n\n#### Defined in\n\nsrc/drivers/types.ts:59\n\n___\n\n### host\n\n• `Optional` **host**: `string`\n\nHost name is required unless connectionString is provided, eg: xxx.sqlitecloud.io\n\n#### Defined in\n\nsrc/drivers/types.ts:25\n\n___\n\n### insecure\n\n• `Optional` **insecure**: `boolean`\n\nConnect using plain TCP port, without TLS encryption, NOT RECOMMENDED, TEST ONLY\n\n#### Defined in\n\nsrc/drivers/types.ts:29\n\n___\n\n### maxData\n\n• `Optional` **maxData**: `number`\n\nDo not send columns with more than max_data bytes\n\n#### Defined in\n\nsrc/drivers/types.ts:47\n\n___\n\n### maxRows\n\n• `Optional` **maxRows**: `number`\n\nServer should chunk responses with more than maxRows\n\n#### Defined in\n\nsrc/drivers/types.ts:49\n\n___\n\n### maxRowset\n\n• `Optional` **maxRowset**: `number`\n\nServer should limit total number of rows in a set to maxRowset\n\n#### Defined in\n\nsrc/drivers/types.ts:51\n\n___\n\n### noBlob\n\n• `Optional` **noBlob**: `boolean`\n\nServer should send BLOB columns\n\n#### Defined in\n\nsrc/drivers/types.ts:45\n\n___\n\n### nonlinearizable\n\n• `Optional` **nonlinearizable**: `boolean`\n\nRequest for immediate responses from the server node without waiting for linerizability guarantees\n\n#### Defined in\n\nsrc/drivers/types.ts:43\n\n___\n\n### password\n\n• `Optional` **password**: `string`\n\nPassword is required unless connection string is provided\n\n#### Defined in\n\nsrc/drivers/types.ts:20\n\n___\n\n### passwordHashed\n\n• `Optional` **passwordHashed**: `boolean`\n\nTrue if password is hashed, default is false\n\n#### Defined in\n\nsrc/drivers/types.ts:22\n\n___\n\n### port\n\n• `Optional` **port**: `number`\n\nPort number for tls socket\n\n#### Defined in\n\nsrc/drivers/types.ts:27\n\n___\n\n### timeout\n\n• `Optional` **timeout**: `number`\n\nOptional query timeout passed directly to TLS socket\n\n#### Defined in\n\nsrc/drivers/types.ts:32\n\n___\n\n### tlsOptions\n\n• `Optional` **tlsOptions**: `ConnectionOptions`\n\nCustom options and configurations for tls socket, eg: additional certificates\n\n#### Defined in\n\nsrc/drivers/types.ts:54\n\n___\n\n### useWebsocket\n\n• `Optional` **useWebsocket**: `boolean`\n\nTrue if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js\n\n#### Defined in\n\nsrc/drivers/types.ts:57\n\n___\n\n### username\n\n• `Optional` **username**: `string`\n\nUser name is required unless connectionString is provided\n\n#### Defined in\n\nsrc/drivers/types.ts:18\n\n___\n\n### verbose\n\n• `Optional` **verbose**: `boolean`\n\nTrue if connection should enable debug logs\n\n#### Defined in\n\nsrc/drivers/types.ts:64","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/interfaces/SQLiteCloudConfig.md","digest":"b04a492f2c3bf54c","rendered":{"html":"

    Configuration for SQLite cloud connection

    \n

    Table of contents

    \n

    Properties

    \n\n

    Properties

    \n

    clientId

    \n

    Optional clientId: string

    \n

    Optional identifier used for verbose logging

    \n

    Defined in

    \n

    src/drivers/types.ts:62

    \n
    \n

    compression

    \n

    Optional compression: boolean

    \n

    Defined in

    \n

    src/drivers/types.ts:41

    \n
    \n

    connectionString

    \n

    Optional connectionString: string

    \n

    Connection string in the form of sqlitecloud://user:password@host:port/database?options

    \n

    Defined in

    \n

    src/drivers/types.ts:15

    \n
    \n

    createDatabase

    \n

    Optional createDatabase: boolean

    \n

    Create the database if it doesn’t exist?

    \n

    Defined in

    \n

    src/drivers/types.ts:37

    \n
    \n

    database

    \n

    Optional database: string

    \n

    Name of database to open

    \n

    Defined in

    \n

    src/drivers/types.ts:34

    \n
    \n

    dbMemory

    \n

    Optional dbMemory: boolean

    \n

    Database will be created in memory

    \n

    Defined in

    \n

    src/drivers/types.ts:39

    \n
    \n

    gatewayUrl

    \n

    Optional gatewayUrl: string

    \n

    Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:4000

    \n

    Defined in

    \n

    src/drivers/types.ts:59

    \n
    \n

    host

    \n

    Optional host: string

    \n

    Host name is required unless connectionString is provided, eg: xxx.sqlitecloud.io

    \n

    Defined in

    \n

    src/drivers/types.ts:25

    \n
    \n

    insecure

    \n

    Optional insecure: boolean

    \n

    Connect using plain TCP port, without TLS encryption, NOT RECOMMENDED, TEST ONLY

    \n

    Defined in

    \n

    src/drivers/types.ts:29

    \n
    \n

    maxData

    \n

    Optional maxData: number

    \n

    Do not send columns with more than max_data bytes

    \n

    Defined in

    \n

    src/drivers/types.ts:47

    \n
    \n

    maxRows

    \n

    Optional maxRows: number

    \n

    Server should chunk responses with more than maxRows

    \n

    Defined in

    \n

    src/drivers/types.ts:49

    \n
    \n

    maxRowset

    \n

    Optional maxRowset: number

    \n

    Server should limit total number of rows in a set to maxRowset

    \n

    Defined in

    \n

    src/drivers/types.ts:51

    \n
    \n

    noBlob

    \n

    Optional noBlob: boolean

    \n

    Server should send BLOB columns

    \n

    Defined in

    \n

    src/drivers/types.ts:45

    \n
    \n

    nonlinearizable

    \n

    Optional nonlinearizable: boolean

    \n

    Request for immediate responses from the server node without waiting for linerizability guarantees

    \n

    Defined in

    \n

    src/drivers/types.ts:43

    \n
    \n

    password

    \n

    Optional password: string

    \n

    Password is required unless connection string is provided

    \n

    Defined in

    \n

    src/drivers/types.ts:20

    \n
    \n

    passwordHashed

    \n

    Optional passwordHashed: boolean

    \n

    True if password is hashed, default is false

    \n

    Defined in

    \n

    src/drivers/types.ts:22

    \n
    \n

    port

    \n

    Optional port: number

    \n

    Port number for tls socket

    \n

    Defined in

    \n

    src/drivers/types.ts:27

    \n
    \n

    timeout

    \n

    Optional timeout: number

    \n

    Optional query timeout passed directly to TLS socket

    \n

    Defined in

    \n

    src/drivers/types.ts:32

    \n
    \n

    tlsOptions

    \n

    Optional tlsOptions: ConnectionOptions

    \n

    Custom options and configurations for tls socket, eg: additional certificates

    \n

    Defined in

    \n

    src/drivers/types.ts:54

    \n
    \n

    useWebsocket

    \n

    Optional useWebsocket: boolean

    \n

    True if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js

    \n

    Defined in

    \n

    src/drivers/types.ts:57

    \n
    \n

    username

    \n

    Optional username: string

    \n

    User name is required unless connectionString is provided

    \n

    Defined in

    \n

    src/drivers/types.ts:18

    \n
    \n

    verbose

    \n

    Optional verbose: boolean

    \n

    True if connection should enable debug logs

    \n

    Defined in

    \n

    src/drivers/types.ts:64

    ","metadata":{"headings":[{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"properties","text":"Properties"},{"depth":2,"slug":"properties-1","text":"Properties"},{"depth":3,"slug":"clientid","text":"clientId"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":3,"slug":"compression","text":"compression"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"connectionstring","text":"connectionString"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"createdatabase","text":"createDatabase"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":3,"slug":"database","text":"database"},{"depth":4,"slug":"defined-in-4","text":"Defined in"},{"depth":3,"slug":"dbmemory","text":"dbMemory"},{"depth":4,"slug":"defined-in-5","text":"Defined in"},{"depth":3,"slug":"gatewayurl","text":"gatewayUrl"},{"depth":4,"slug":"defined-in-6","text":"Defined in"},{"depth":3,"slug":"host","text":"host"},{"depth":4,"slug":"defined-in-7","text":"Defined in"},{"depth":3,"slug":"insecure","text":"insecure"},{"depth":4,"slug":"defined-in-8","text":"Defined in"},{"depth":3,"slug":"maxdata","text":"maxData"},{"depth":4,"slug":"defined-in-9","text":"Defined in"},{"depth":3,"slug":"maxrows","text":"maxRows"},{"depth":4,"slug":"defined-in-10","text":"Defined in"},{"depth":3,"slug":"maxrowset","text":"maxRowset"},{"depth":4,"slug":"defined-in-11","text":"Defined in"},{"depth":3,"slug":"noblob","text":"noBlob"},{"depth":4,"slug":"defined-in-12","text":"Defined in"},{"depth":3,"slug":"nonlinearizable","text":"nonlinearizable"},{"depth":4,"slug":"defined-in-13","text":"Defined in"},{"depth":3,"slug":"password","text":"password"},{"depth":4,"slug":"defined-in-14","text":"Defined in"},{"depth":3,"slug":"passwordhashed","text":"passwordHashed"},{"depth":4,"slug":"defined-in-15","text":"Defined in"},{"depth":3,"slug":"port","text":"port"},{"depth":4,"slug":"defined-in-16","text":"Defined in"},{"depth":3,"slug":"timeout","text":"timeout"},{"depth":4,"slug":"defined-in-17","text":"Defined in"},{"depth":3,"slug":"tlsoptions","text":"tlsOptions"},{"depth":4,"slug":"defined-in-18","text":"Defined in"},{"depth":3,"slug":"usewebsocket","text":"useWebsocket"},{"depth":4,"slug":"defined-in-19","text":"Defined in"},{"depth":3,"slug":"username","text":"username"},{"depth":4,"slug":"defined-in-20","text":"Defined in"},{"depth":3,"slug":"verbose","text":"verbose"},{"depth":4,"slug":"defined-in-21","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"SQLiteCloudConfig","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"imagePaths":[]}},"collection":"docs"}},{"title":"Modules","filePath":"sdk-js-modules","type":"inner","level":1,"entry":{"id":"sdk-js-modules","data":{"title":"Modules","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"## Table of contents\n\n### Classes\n\n- [Database](sqlite-cloud/sdks/js/classes/database)\n- [SQLiteCloudConnection](sqlite-cloud/sdks/js/classes/sqlitecloudconnection)\n- [SQLiteCloudError](sqlite-cloud/sdks/js/classes/sqliteclouderror)\n- [SQLiteCloudRow](sqlite-cloud/sdks/js/classes/sqlitecloudrow)\n- [SQLiteCloudRowset](sqlite-cloud/sdks/js/classes/sqlitecloudrowset)\n- [Statement](sqlite-cloud/sdks/js/classes/statement)\n\n### Interfaces\n\n- [SQLCloudRowsetMetadata](sqlite-cloud/sdks/js/interfaces/sqlcloudrowsetmetadata)\n- [SQLiteCloudConfig](sqlite-cloud/sdks/js/interfaces/sqlitecloudconfig)\n\n### Type Aliases\n\n- [ErrorCallback](modules#errorcallback)\n\n### Functions\n\n- [escapeSqlParameter](modules#escapesqlparameter)\n- [parseConnectionString](modules#parseconnectionstring)\n- [prepareSql](modules#preparesql)\n- [validateConfiguration](modules#validateconfiguration)\n\n## Type Aliases\n\n### ErrorCallback\n\nƬ **ErrorCallback**: (`error`: `Error` \\| ``null``) => `void`\n\n#### Type declaration\n\n▸ (`error`): `void`\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `error` | `Error` \\| ``null`` |\n\n##### Returns\n\n`void`\n\n#### Defined in\n\nsrc/drivers/types.ts:120\n\n## Functions\n\n### escapeSqlParameter\n\n▸ **escapeSqlParameter**(`param`): `string`\n\nTakes a generic value and escapes it so it can replace ? as a binding in a prepared SQL statement\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `param` | `SQLiteCloudDataTypes` |\n\n#### Returns\n\n`string`\n\n#### Defined in\n\nsrc/drivers/utilities.ts:70\n\n___\n\n### parseConnectionString\n\n▸ **parseConnectionString**(`connectionString`): [`SQLiteCloudConfig`](interfaces/sqlitecloudconfig)\n\nParse connectionString like sqlitecloud://username:password@host:port/database?option1=xxx&option2=xxx into its components\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `connectionString` | `string` |\n\n#### Returns\n\n[`SQLiteCloudConfig`](interfaces/sqlitecloudconfig)\n\n#### Defined in\n\nsrc/drivers/utilities.ts:210\n\n___\n\n### prepareSql\n\n▸ **prepareSql**(`sql`, `...params`): `string`\n\nTake a sql statement and replaces ? or $named parameters that are properly serialized and escaped.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `sql` | `string` |\n| `...params` | (`SQLiteCloudDataTypes` \\| `SQLiteCloudDataTypes`[])[] |\n\n#### Returns\n\n`string`\n\n#### Defined in\n\nsrc/drivers/utilities.ts:105\n\n___\n\n### validateConfiguration\n\n▸ **validateConfiguration**(`config`): [`SQLiteCloudConfig`](interfaces/sqlitecloudconfig)\n\nValidate configuration, apply defaults, throw if something is missing or misconfigured\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `config` | [`SQLiteCloudConfig`](interfaces/sqlitecloudconfig) |\n\n#### Returns\n\n[`SQLiteCloudConfig`](interfaces/sqlitecloudconfig)\n\n#### Defined in\n\nsrc/drivers/utilities.ts:173","filePath":"docs-website/content/docs/sqlite-cloud/sdks/js/modules.md","digest":"dba9bafe0eb8cc15","rendered":{"html":"

    Table of contents

    \n

    Classes

    \n\n

    Interfaces

    \n\n

    Type Aliases

    \n\n

    Functions

    \n\n

    Type Aliases

    \n

    ErrorCallback

    \n

    Ƭ ErrorCallback: (error: Error | null) => void

    \n

    Type declaration

    \n

    ▸ (error): void

    \n
    Parameters
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    errorError | null
    \n
    Returns
    \n

    void

    \n

    Defined in

    \n

    src/drivers/types.ts:120

    \n

    Functions

    \n

    escapeSqlParameter

    \n

    escapeSqlParameter(param): string

    \n

    Takes a generic value and escapes it so it can replace ? as a binding in a prepared SQL statement

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    paramSQLiteCloudDataTypes
    \n

    Returns

    \n

    string

    \n

    Defined in

    \n

    src/drivers/utilities.ts:70

    \n
    \n

    parseConnectionString

    \n

    parseConnectionString(connectionString): SQLiteCloudConfig

    \n

    Parse connectionString like sqlitecloud://username:password@host:port/database?option1=xxx&#x26;option2=xxx into its components

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    connectionStringstring
    \n

    Returns

    \n

    SQLiteCloudConfig

    \n

    Defined in

    \n

    src/drivers/utilities.ts:210

    \n
    \n

    prepareSql

    \n

    prepareSql(sql, ...params): string

    \n

    Take a sql statement and replaces ? or $named parameters that are properly serialized and escaped.

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    sqlstring
    ...params(SQLiteCloudDataTypes | SQLiteCloudDataTypes[])[]
    \n

    Returns

    \n

    string

    \n

    Defined in

    \n

    src/drivers/utilities.ts:105

    \n
    \n

    validateConfiguration

    \n

    validateConfiguration(config): SQLiteCloudConfig

    \n

    Validate configuration, apply defaults, throw if something is missing or misconfigured

    \n

    Parameters

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n
    NameType
    configSQLiteCloudConfig
    \n

    Returns

    \n

    SQLiteCloudConfig

    \n

    Defined in

    \n

    src/drivers/utilities.ts:173

    ","metadata":{"headings":[{"depth":2,"slug":"table-of-contents","text":"Table of contents"},{"depth":3,"slug":"classes","text":"Classes"},{"depth":3,"slug":"interfaces","text":"Interfaces"},{"depth":3,"slug":"type-aliases","text":"Type Aliases"},{"depth":3,"slug":"functions","text":"Functions"},{"depth":2,"slug":"type-aliases-1","text":"Type Aliases"},{"depth":3,"slug":"errorcallback","text":"ErrorCallback"},{"depth":4,"slug":"type-declaration","text":"Type declaration"},{"depth":5,"slug":"parameters","text":"Parameters"},{"depth":5,"slug":"returns","text":"Returns"},{"depth":4,"slug":"defined-in","text":"Defined in"},{"depth":2,"slug":"functions-1","text":"Functions"},{"depth":3,"slug":"escapesqlparameter","text":"escapeSqlParameter"},{"depth":4,"slug":"parameters-1","text":"Parameters"},{"depth":4,"slug":"returns-1","text":"Returns"},{"depth":4,"slug":"defined-in-1","text":"Defined in"},{"depth":3,"slug":"parseconnectionstring","text":"parseConnectionString"},{"depth":4,"slug":"parameters-2","text":"Parameters"},{"depth":4,"slug":"returns-2","text":"Returns"},{"depth":4,"slug":"defined-in-2","text":"Defined in"},{"depth":3,"slug":"preparesql","text":"prepareSql"},{"depth":4,"slug":"parameters-3","text":"Parameters"},{"depth":4,"slug":"returns-3","text":"Returns"},{"depth":4,"slug":"defined-in-3","text":"Defined in"},{"depth":3,"slug":"validateconfiguration","text":"validateConfiguration"},{"depth":4,"slug":"parameters-4","text":"Parameters"},{"depth":4,"slug":"returns-4","text":"Returns"},{"depth":4,"slug":"defined-in-4","text":"Defined in"}],"localImagePaths":[],"remoteImagePaths":[],"frontmatter":{"title":"Modules","description":"SQLite Cloud Javascript SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish","slug":"sdk-js-modules"},"imagePaths":[]}},"collection":"docs"}},{"title":"Introduction","type":"inner","filePath":"sdk-python-introduction","level":1,"entry":{"id":"sdk-python-introduction","data":{"title":"Python SDK Introduction","description":"SQLite Cloud Python SDK","customClass":"sdk-doc js-doc","category":"sdks","status":"publish"},"body":"## Install\n\n```bash\npip install sqlitecloud\n```\n\n## Basic Usage\n\nWe aim for full compatibility with the established sqlite3 API, with the primary distinction being that our driver connects to SQLite Cloud databases. This allows you to migrate your SQLite to the cloud while continuing to use your existing codebase.\n\n```python\nimport sqlitecloud\n\n# Open the connection to SQLite Cloud\nconn = sqlitecloud.connect(\"sqlitecloud://myhost.sqlite.cloud:8860?apikey=myapikey\")\n\n# You can autoselect the database during the connect call\n# by adding the database name as path of the SQLite Cloud\n# connection string, eg:\n# conn = sqlitecloud.connect(\"sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey\")\ndb_name = \"chinook.sqlite\"\nconn.execute(f\"USE DATABASE {db_name}\")\n\ncursor = conn.execute(\"SELECT * FROM albums WHERE AlbumId = ?\", (1, ))\nresult = cursor.fetchone()\n\nprint(result)\n\nconn.close()\n```\n\n## Using SQLite Cloud with Pandas\n \n```python \nimport io\n\nimport pandas as pd\n\nimport sqlitecloud\n\ndfprices = pd.read_csv(\n io.StringIO(\n \"\"\"DATE,CURRENCY,PRICE\n 20230504,USD,201.23456\n 20230503,USD,12.34567\n 20230502,USD,23.45678\n 20230501,USD,34.56789\"\"\"\n )\n)\n\n# Your SQLite Cloud connection string\nconn = sqlitecloud.connect(\"sqlitecloud://myhost.sqlite.cloud:8860/mydatabase.sqlite?apikey=myapikey\")\n\nconn.executemany(\"DROP TABLE IF EXISTS ?\", [(\"PRICES\",)])\n\n# Write the dataframe to the SQLite Cloud database as a table PRICES\ndfprices.to_sql(\"PRICES\", conn, index=False)\n\n# Create the dataframe from the table PRICES on the SQLite Cloud database\ndf_actual_prices = pd.read_sql(\"SELECT * FROM PRICES\", conn)\n\n# Inspect the dataframe\nprint(df_actual_prices.head())\n\n# Perform a simple query on the dataframe\nquery_result = df_actual_prices.query(\"PRICE > 50.00\")\n\nprint(query_result)\n```\n\n## Using SQLite Cloud with SQLAlchemy\n\n```bash\npip install sqlalchemy-sqlitecloud\n```\n\n```python\nimport sqlalchemy\nfrom sqlalchemy import Column, ForeignKey, Integer, String\nfrom sqlalchemy.dialects import registry\nfrom sqlalchemy.orm import backref, declarative_base, relationship, sessionmaker\n\nBase = declarative_base()\n\n\nclass Artist(Base):\n __tablename__ = \"artists\"\n\n ArtistId = Column(\"ArtistId\", Integer, primary_key=True)\n Name = Column(\"Name\", String)\n Albums = relationship(\"Album\", backref=backref(\"artist\"))\n\n\nclass Album(Base):\n __tablename__ = \"albums\"\n\n AlbumId = Column(\"AlbumId\", Integer, primary_key=True)\n ArtistId = Column(\"ArtistId\", Integer, ForeignKey(\"artists.ArtistId\"))\n Title = Column(\"Title\", String)\n\n# Your SQLite Cloud connection string\nconnection_string = \"sqlitecloud://myhost.sqlite.cloud:8860/mydatabase.sqlite?apikey=myapikey\"\n\nengine = sqlalchemy.create_engine(connection_string)\nSession = sessionmaker(bind=engine)\nsession = Session()\n\nname = \"John Doe\"\nquery = sqlalchemy.insert(Artist).values(Name=name)\nresult_insert = session.execute(query)\n\ntitle = \"The Album\"\nquery = sqlalchemy.insert(Album).values(\n ArtistId=result_insert.lastrowid, Title=title\n)\nsession.execute(query)\n\nquery = (\n sqlalchemy.select(Artist, Album)\n .join(Album, Artist.ArtistId == Album.ArtistId)\n .where(Artist.ArtistId == result_insert.lastrowid)\n)\n\nresult = session.execute(query).fetchone()\n\nprint(\"Artist Name: \" + result[0].Name)\nprint(\"Album Title: \" + result[1].Title)\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/python/introduction.mdx","digest":"f578937c23f1d44e","deferredRender":true,"collection":"docs"}},{"title":"Introduction","type":"inner","filePath":"sdk-go-introduction","level":1,"entry":{"id":"sdk-go-introduction","data":{"title":"GO SDK Getting Started","description":"Here's the how gettting started to use the SQLite Cloud in your Go code.","customClass":"","category":"sdks","status":"publish"},"body":"## Use the SQLite Cloud SDK in your Go code \n\n1. Import the package in your Go source code:\n\n ```go\n import sqlitecloud \"github.com/sqlitecloud/sqlitecloud-go\"\n ```\n\n2. Download the package, and run the `go mod tidy` command to synchronize your module's dependencies:\n\n ```bash\n $ go mod tidy \n go: downloading github.com/sqlitecloud/sqlitecloud-go v1.0.0\n ```\n\n3. Connect to a SQLite Cloud database with a valid [connection string](#get-a-connection-string):\n\n ```go\n db, err := sqlitecloud.Connect(\"sqlitecloud://user:pass@host.sqlite.cloud:port/dbname\")\n ```\n\n4. Execute queries using a [method](#api-documentation) defined on the `SQCloud` struct, for example `Select`:\n\n ```go\n result, _ := db.Select(\"SELECT * FROM table1;\")\n ```\n\nThe following example shows how to print the content of the table `table1`:\n\n```go\npackage main\n\nimport (\n \"fmt\"\n \"strings\"\n\n sqlitecloud \"github.com/sqlitecloud/sqlitecloud-go\"\n)\n\nconst connectionString = \"sqlitecloud://admin:password@host.sqlite.cloud:8860/dbname.sqlite\"\n\nfunc main() {\n db, err := sqlitecloud.Connect(connectionString)\n if err != nil {\n fmt.Println(\"Connect error: \", err)\n }\n\n tables, _ := db.ListTables()\n fmt.Printf(\"Tables:\\n\\t%s\\n\", strings.Join(tables, \"\\n\\t\"))\n\n fmt.Printf(\"Table1:\\n\")\n result, _ := db.Select(\"SELECT * FROM t1;\")\n for r := uint64(0); r < result.GetNumberOfRows(); r++ {\n id, _ := result.GetInt64Value(r, 0)\n value, _ := result.GetStringValue(r, 1)\n fmt.Printf(\"\\t%d: %s\\n\", id, value)\n }\n}\n```\n\n## Get a connection string\n\nYou can connect to any cloud database using a special connection string in the form:\n\n```\nsqlitecloud://user:pass@host.com:port/dbname?timeout=10&key2=value2&key3=value3\n```\n\nTo get a valid connection string, follow these instructions:\n\n- Get a SQLite Cloud account. See the documentation for details.\n- Create a SQLite Cloud project\n- Create a SQLite Cloud database\n- Get the connection string by clicking on the node address in the Dashboard Nodes section. A valid connection string will be copied to your clipboard.\n- Add the database name to your connection string.\n\n## API Documentation\n\nThe complete documentation is available\nhere.\n\n\n \"Test\n\n\n
    \n\n\n \"codecov\"\n\n\n
    \n\n\n \"GitHub\n\n\n
    \n\n\n \"GitHub\n\n\nSQLite Cloud for Go is a powerful package that allows you to interact with the SQLite Cloud database seamlessly. It provides methods for various database operations. This package is designed to simplify database operations in Go applications, making it easier than ever to work with SQLite Cloud. In addition to the standard SQLite statements, several other [commands](server-side-commands) are supported.","filePath":"docs-website/content/docs/sqlite-cloud/sdks/go/introduction.mdx","digest":"5a1d1f409ccd1f78","deferredRender":true,"collection":"docs"}},{"title":"Introduction","type":"inner","filePath":"sdk-php-introduction","level":1,"entry":{"id":"sdk-php-introduction","data":{"title":"PHP SDK Getting Started","description":"Get started with SQLite Cloud using PHP.","customClass":"","category":"sdks","status":"publish"},"body":"This powerful package provides methods that simplify performing database operations in PHP applications, making it easier than ever to work with SQLite in the cloud. We encourage all users to log encountered issues in the SDK’s issues backlog.\n\n## Install\n\n - Run the following command to initialize a PHP project and install the SDK.\n\n```bash\n$ composer require sqlitecloud/sqlitecloud\n```\n\n## Configure your database connection\n\n - In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `` below.\n\n```php\n$sqlite->connectWithString(\"\");\n```\n\n - You can modify the connection string to include the name of the database to query.\n - Here, the provided port (`8860`) and database (`chinook.sqlite`) will query the sample dataset that comes pre-loaded with SQLite Cloud. Replace to query your own datasets.\n\n```php\n$sqlite->connectWithString('sqlitecloud://{hostname}:8860/chinook.sqlite?apikey={apikey}');\n```\n\n## Connect and query\n\n - Include the following snippet in a new `example.php` file.\n - NOTE: `$sqlite->execute(\"USE DATABASE {$db_name}\");` is only necessary if your connection string does NOT specify the name of the database to query.\n\n```php\nconnectWithString(\"\");\n\n$db_name = 'chinook.sqlite';\n$sqlite->execute(\"USE DATABASE {$db_name}\");\n\n/** @var SQLiteCloudRowset */\n$rowset = $sqlite->execute('SELECT * FROM albums WHERE ArtistId = 2');\n\nprintf('%d rows' . PHP_EOL, $rowset->nrows);\nprintf('%s | %s | %s' . PHP_EOL, $rowset->name(0), $rowset->name(1), $rowset->name(2));\nfor ($i = 0; $i < $rowset->nrows; $i++) {\n printf('%s | %s | %s' . PHP_EOL, $rowset->value($i, 0), $rowset->value($i, 1), $rowset->value($i, 2));\n}\n\n$sqlite->disconnect();\n```\n\n - Run your app! \n \n```\nphp example.php\n```\n\n## PHP Admin Dashboard\n\nYou can use SQLite Cloud's simplified PHP Admin interface to administer any node.\n\n - Clone the PHP SDK, install lock file dependencies, and run the dashboard locally.\n\n```bash\ngit clone https://github.com/sqlitecloud/sqlitecloud-php.git\n\ncomposer update # or composer install\ncd admin\nphp -S localhost:8000\n```\n\n - Login as your admin user.\n - In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Deployment string, and paste in `Hostname`.\n - In your dashboard left nav, select Settings, then Users. Copy your admin user's username and paste in `Username`.\n - In your User's row, click the down chevron, then Edit. Enter a Password and Save. Paste in `Password`.\n\n![PHP Admin Login](@docs-website-assets/php/admin_login.png)\n\n![PHP Admin Overview](@docs-website-assets/php/admin_overview.png)\n\n[test-qa-img]: https://github.com/sqlitecloud/sqlitecloud-php/actions/workflows/deploy.yaml/badge.svg?branch=main\n[test-qa-url]: https://github.com/sqlitecloud/sqlitecloud-php/actions/workflows/deploy.yaml\n[codecov-img]: https://codecov.io/gh/sqlitecloud/sqlitecloud-php/graph/badge.svg?token=3FFHULGCOY\n[codecov-url]: https://codecov.io/gh/sqlitecloud/sqlitecloud-php\n[packagist-version-img]: https://img.shields.io/packagist/v/sqlitecloud/sqlitecloud\n[packagist-url]: https://packagist.org/packages/sqlitecloud/sqlitecloud\n[php-img]: https://img.shields.io/packagist/dependency-v/sqlitecloud/sqlitecloud/php","filePath":"docs-website/content/docs/sqlite-cloud/sdks/php/introduction.mdx","digest":"e136e2508bd620e8","deferredRender":true,"collection":"docs"}},{"title":"Methods","filePath":"sdk-php-methods","type":"inner","level":1,"entry":{"id":"sdk-php-methods","data":{"title":"PHP SDK Methods","description":"Methods available in the SQLite Cloud PHP SDK.","customClass":"","category":"sdks","status":"publish"},"body":"## Connect\n```php\nSQLiteCloudClient.connect($hostname, $port = 8860)\nSQLiteCloudClient.connectWithString('sqlitecloud://myhost.sqlite.cloud:8860?apikey=myapikey')\n```\n\nTo connect to SQLite Cloud, you need to first allocate an SQLiteCloud Client instance and then inizialize some mandatory public properties: connection string or username and password. The SQLiteCloud PHP class has the following properties:\n```php\nclass SQLiteCloudClient {\n\tpublic $username = '';\n\tpublic $password = '';\n\tpublic $database = '';\n\tpublic $timeout = NULL;\n\tpublic $connect_timeout = 20;\n\tpublic $compression = false;\n // ...and more\n}\n```\n\n### Example with Connection String\n\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\n\n$sqlitecloud = new SQLiteCloudClient();\n\ntry {\n\tif ($sqlitecloud->connectWithString('sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey') == false) {\n\t\t$msg = $sqlitecloud->errmsg;\n\t\treturn $msg;\n\t}\n} catch (Exception $e) {\n\treturn $e->getMessage();\n}\n\nreturn true;\n```\n\n### Example with Username and Password\n\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\n\n$sqlitecloud = new SQLiteCloudClient();\n$sqlitecloud->username = 'admin';\n$sqlitecloud->password = 'pass';\n\ntry {\n\tif ($sqlitecloud->connect('mynode.sqlite.cloud', 8860) == false) {\n\t\t$msg = $sqlitecloud->errmsg;\n\t\treturn $msg;\n\t}\n} catch (Exception $e) {\n\treturn $e->getMessage();\n}\n\nreturn true;\n```\n\n## Execute\n```php\nSQLiteCloudClient.execute($command)\n```\n\nSubmits a command to the server and waits for the result. The command can be any SQLite statement or any built-in [SQLite Cloud command](/docs/commands).\n\n### Return value\n* `false` is returned in case of an error\n* `true` is returned in case of OK reply\n* `NULL` is returned in case of NULL reply\n* An `integer` or a `double` in case of numeric reply\n* A `string` if the reply is a string value\n* A PHP `array` if the reply contains multiple values\n* An `SQLiteCloudRowset` instance in case of a query reply\n\n### Example\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\n\n$sqlitecloud = new SQLiteCloudClient();\n$sqlitecloud->connectWithString('sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey')\n\n$result = $sqlitecloud->execute('LIST INFO');\n\n$sqlitecloud->disconnect();\n```\n## Dump\n```php\nSQLiteCloudRowset.dump()\n```\n\nPrint the Rowset on standard output.\n\n### Example\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\n\n$sqlitecloud = new SQLiteCloudCient();\n$sqlitecloud->connectWithString('sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey')\n\n$result = $sqlitecloud->execute('LIST INFO');\n$result->dump();\n\n$sqlitecloud->disconnect();\n```\n## Name\n```php\nSQLiteCloudRowset.name($col)\n```\n\nUse the function to retrieve the name of a column in the Rowset at index $col (from 0 to SQLiteCloudRowset.ncols).\n\n## Return value\nA `string` with the column name.\n\n### Example\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\nuse SQLiteCloud\\SQLiteCloudRowset;\n\n$sqlitecloud = new SQLiteCloudClient();\n$sqlitecloud->connectWithString('sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey')\n\n/** @var SQLiteCloudRowset */\n$result = $sqlitecloud->execute('LIST INFO');\n$col1name = $result->name(0);\n\n$sqlitecloud->disconnect();\n```\n## Value\n```php\nSQLiteCloudRowset.value($row, $col)\n```\n\nUse the function to retrieve the value of an item in the Rowset at row $row (from 0 to SQLiteCloudRowset.nrows) and column $col (from 0 to SQLiteCloudRowset.ncols).\n\n### Return value\nThe column value.\n\n### Example\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\nuse SQLiteCloud\\SQLiteCloudRowset;\n\n$sqlitecloud = new SQLiteCloudClient();\n$sqlitecloud->connectWithString('sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey')\n\n/** @var SQLiteCloudRowset */\n$result = $sqlitecloud->execute('LIST INFO');\n$col = 1;\n$row = 1;\n$value = $result->value($row, $col);\n\n$sqlitecloud->disconnect();\n```\n\n## Disconnect\n\n```php\nSQLiteCloudClient.disconnect()\n```\n\nThe **disconnect** public method closes the connection with the server.\n\n### Example\n```php\nuse SQLiteCloud\\SQLiteCloudClient;\n\n$sqlitecloud = new SQLiteCloudClient();\n$sqlitecloud->connectWithString('sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey')\n\n$sqlitecloud->disconnect();\n```","filePath":"docs-website/content/docs/sqlite-cloud/sdks/php/methods.mdx","digest":"633c1696389db639","deferredRender":true,"collection":"docs"}},{"title":"Introduction","type":"inner","filePath":"sdk-swift-introduction","level":1,"entry":{"id":"sdk-swift-introduction","data":{"title":"Swift SDK Introduction","description":"Get started with SQLite Cloud using Swift.","customClass":"","category":"sdks","status":"publish"},"body":"This powerful package provides methods that perform DB operations, and enables real-time notifications in Swift apps, making it easier than ever to work with SQLite in the cloud. We encourage all users to log encountered issues in the SDK's issues backlog.\n\n## Install\n\n - In `Package.swift`, add the `swift` package to `dependencies`.\n\n```swift\nlet package = Package(\n ...,\n dependencies: [\n ...,\n .package(url: \"https://github.com/sqlitecloud/swift.git\", from: \"0.2.1\")\n ],\n ...\n)\n```\n\n## 3 ways to configure your database connection\n\n1. **RECOMMENDED**: Use the `apikey` connection string.\n\n - In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `` below.\n\n```swift\nlet configuration = SQLiteCloudConfig(connectionString: \"\")\n```\n\n - You can modify the connection string to include the name of the database to query.\n\n```swift\nlet configuration = SQLiteCloudConfig(connectionString: \"sqlitecloud://{hostname}:8860/{database}?apikey={apikey}\")\n``` \n\n2. Use a parameterized connection string.\n\n - In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Deployment string, and replace `{hostname}` below.\n - In your dashboard left nav, select Settings, then Users. Copy your username and replace `{username}`.\n - In your User's row, click the down chevron, then Edit. Enter a Password and Save. Replace `{password}`.\n - Here, the provided port (`8860`) and database (`chinook.sqlite`) will query the sample dataset that comes pre-loaded with SQLite Cloud. Replace to query your own datasets.\n\n```swift\nlet configuration = SQLiteCloudConfig(connectionString: \"sqlitecloud://{username}:{password}@{hostname}:8860/chinook.sqlite\")\n```\n \n3. Pass each connection string parameter explicitly.\n\n```swift\nlet configuration = SQLiteCloudConfig(hostname: {hostname}, username: {username}, password: {password}, port: .default)\n```\n\n## Connect and query\n\n - The following snippet includes variable types, which may be optional for your app.\n - NOTE: `USE DATABASE chinook.sqlite;` is only necessary in the query if your `configuration` does not specify the name of the database to query.\n - Once you've incorporated the following, build and run your app!\n\n```swift\nimport SQLiteCloud\n\nlet configuration: SQLiteCloudConfig? = SQLiteCloudConfig(connectionString: \"\")\n\nlet sqliteCloud: SQLiteCloud = SQLiteCloud(config: configuration!)\n\ndo {\n try await sqliteCloud.connect()\n debugPrint(\"connected\")\n\n let sqlQuery: String = \"USE DATABASE chinook.sqlite; SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist FROM albums INNER JOIN artists WHERE artists.ArtistId = albums.ArtistId LIMIT 20;\"\n\n let result: SQLiteCloudResult = try await sqliteCloud.execute(query: sqlQuery)\n\n try await sqliteCloud.disconnect()\n\n return result.stringValue!\n} catch {\n return \"Connection error\"\n}\n```\n\n## Troubleshooting\n\n - If you get errors indicating SQLite Cloud-specific constructs are out of scope (i.e. `error: cannot find 'SQLiteCloudConfig' in scope`), verify the `SQLiteCloud` package is correctly imported.\n - Confirm `https://github.com/sqlitecloud/swift` package is listed in `Package.resolved`.","filePath":"docs-website/content/docs/sqlite-cloud/sdks/swift/introduction.mdx","digest":"6d186ad1d2641d26","deferredRender":true,"collection":"docs"}},{"title":"Introduction","filePath":"server-side-commands","type":"inner","level":1,"entry":{"id":"server-side-commands","data":{"title":"Server-side Commands - SQLite Cloud","description":"Learn about the server side commands in SQLite Cloud.","customClass":"","category":"reference","status":"publish"},"body":"## Overview\nIn addition to the standard SQL statements supported by the SQLite engine, SQLite Cloud also understands a number of server-specific commands (92 in the current version).\n\nIn general, commands that begin with LIST are intended to query the server for information and SQLite Cloud returns the information in the form of Rowset (see SCSP protocol for more details). The GET verb is used to read a single value (or an array of values in some cases) and the SET verb is used to update an existing setting. Commands that do not begin with LIST and GET are intended to make a change on the server.\n\nMost commands require special privileges to execute. If you are logged into a server with an account that has insufficient privileges to execute a particular command, then SQLite Cloud will return an error.\n\nIn the Syntax field of each command, the keywords that make up the command are shown in uppercase and the values passed as parameters are surrounded by the angle brackets. The square brackets delimit the optional parts of a command (if any).\n\nTo get a list of all available commands, you can send a LIST COMMANDS statement:\n\n```bash\n> LIST COMMANDS\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/server-side-commands.mdx","digest":"c49c4d11e3cde41e","deferredRender":true,"collection":"docs"}},{"title":"API Keys","filePath":"api-key-commands","type":"inner","level":1,"entry":{"id":"api-key-commands","data":{"title":"API Key Commands","description":"Learn about APIKEY commands in SQLite Cloud.","customClass":"","category":"reference","status":"publish"},"body":"## CREATE APIKEY USER\nThe CREATE APIKEY USER command creates a new APIKEY associated to a specific username and with a mnemonic name. The RESTRICTION option is currently unused and an expiration date can be set using the EXPIRATION parameter.\n\nIt returns a String with the new APIKEY.\n\n### Syntax\n```bash\nCREATE APIKEY USER **username** NAME **key_name** [RESTRICTION **restriction_type**] [EXPIRATION **expiration_date**]\n```\n### Privileges\n```bash\nUSERADMIN\n```\n\n## LIST APIKEYS\nThe LIST APIKEYS command retrieves all the APIKEYS created on the server. The USER parameter can be used to filter the result further.\n\nIt returns a Rowset with the following columns:\n* **username**: user name\n* **key**: API KEY\n* **name**: mnemonic name\n* **creation_date**: API KEY creation date and time\n* **expiration_date**: API KEY expiration date and time (if any)\n* **restriction**: always 0 in this version\n\n### Syntax\nLIST APIKEYS [USER **username**]\n\n### Privileges\n```bash\nUSERADMIN\n```\n\n## LIST MY APIKEYS\nThe LIST MY APIKEYS command returns a list of all the APIKEYs associated with the username used in the current connection.\n\nIt returns a Rowset with the following columns:\n* **username**: user name\n* **key**: API KEY\n* **name**: mnemonic name\n* **creation_date**: API KEY creation date and time\n* **expiration_date**: API KEY expiration date and time (if any)\n* **restriction**: always 0 in this version\n\n### Syntax\nLIST APIKEYS [USER **username**]\n\n### Privileges\n```bash\nUSERADMIN\n```\n\n## SET APIKEY\nThe SET KEY command sets or updates a **keyname** to a specific **keyvalue**. Once set, the server immediately uses the updated value (and automatically distributes it on the cluster).\n\nIt returns OK string or error value (see SCSP protocol).\n\n\n### Syntax\nSET KEY **keyname** TO **keyvalue**\n\n### Privileges\n```bash\nSETTINGS\n```\n\n\n## REMOVE APIKEY\nThe REMOVE APIKEY command permanently removes an APIKEY from the server.\n\nIt returns OK string or error value (see SCSP protocol).\n\n\n### Syntax\nREMOVE APIKEY **key**\n\n### Privileges\n```bash\nUSERADMIN\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/api-key-commands.mdx","digest":"cc71ca55d5f3fdfe","deferredRender":true,"collection":"docs"}},{"title":"Authentication","filePath":"auth-commands","type":"inner","level":1,"entry":{"id":"auth-commands","data":{"title":"Auth Commands","description":"The AUTH command authenticates the current connection, without authentication the connection cannot send any other command to the server","customClass":"","category":"reference","status":"publish"},"body":"## AUTH USER\nThe AUTH command authenticates the current connection, without authentication the connection cannot send any other command to the server.\n\nOnce authenticated, any PubSub connection in place will be closed.\n### Syntax\n\nAUTH USER **username** PASSWORD **password**\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).","filePath":"docs-website/content/docs/sqlite-cloud/reference/auth-commands.mdx","digest":"1bed1769b6f7fac1","deferredRender":true,"collection":"docs"}},{"title":"Backups","filePath":"backup-commands","type":"inner","level":1,"entry":{"id":"backup-commands","data":{"title":"Backup Commands","description":"Backup-related commands in SQLite Cloud","customClass":"","category":"reference","status":"publish"},"body":"## APPLY BACKUP SETTINGS\nSeveral backup-related settings can be applied using the SET DATABASE KEY command.\n\nThe following keys affect the backup settings:\n* **backup**: set to 1 to activate a backup, 0 to disable.\n* **backup_retention**: affects the disk space needed to store backup information about a specific database. You can specify a `backup_retention` settings using values like 24h, 2.5h, or 2h45m.\n* **backup_snapshot_interval**: specifies how often new snapshots will be created. This setting reduces the time to restore since newer snapshots will have fewer WAL frames to apply.\n\nAll the above settings are not immediately applied up until an APPLY BACKUP SETTINGS command is executed.\n\n### Syntax\n\nAPPLY BACKUP SETTINGS\n\n### Privileges\n\n```\nBACKUP\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n\n## LIST BACKUP SETTINGS\n\nThe LIST BACKUP SETTINGS command retrieves detailed information about the settings applied to each database previously enabled for a backup.\nThe `backup_retention` setting affects the disk space needed to store backup information about a specific database. You can specify a `backup_retention` settings using values like 24h, 2.5h, or 2h45m.\nThe `backup_snapshot_interval` specifies how often new snapshots will be created. This setting reduces the time to restore since newer snapshots will have fewer WAL frames to apply. Retention still applies to these snapshots. If you do not set a snapshot interval, a new snapshot will be created whenever retention is performed. Retention occurs every 24 hours by default.\n\n### Syntax\n\nLIST BACKUP SETTINGS\n\n### Privileges\n\n```\nBACKUP\n```\n\n### Return\n\nA Rowset with the following columns:\n* **name**: database name\n* **enabled**: 1 enabled, 0 disabled\n* **backup_retention**: retention period\n* **backup_snapshot_interval**: snapshot interval value\n\n### Example\n\n```bash\n> LIST BACKUP SETTINGS\n------------------------|---------|------------------|--------------------------|\n name | enabled | backup_retention | backup_snapshot_interval |\n------------------------|---------|------------------|--------------------------|\n chinook-enc.sqlite | 1 | 24h | NULL |\n chinook.sqlite | 1 | 168h | NULL |\n db space.sqlite | 0 | NULL | NULL |\n db1.sqlite | 1 | 168h | NULL |\n dbempty.sqlite | 1 | 24h | NULL |\n encdb.sqlite | 1 | 168h | NULL |\n encdb2.sqlite | 1 | 24h | NULL |\n test-blob-10x10.sqlite | 0 | NULL | NULL |\n wrongdb5.sqlite | 0 | 24h | NULL |\n wrongdb9.sqlite | 0 | NULL | NULL |\n------------------------|---------|------------------|--------------------------|\n```\n\n## LIST BACKUPS DATABASE\n\nThe LIST BACKUPS DATABASE command retrieves detailed information about which backups are available for a specific database.\nSQLite Cloud backup is a continuous backup system based on LiteStream that uses S3 as a storage option and can also backup AES-256 encrypted databases.\n\n### Syntax\nLIST BACKUPS DATABASE **database_name**\n\n### Privileges\n\n```\nBACKUP\n```\n\n### Return\n\nA Rowset with the following columns:\n* **type**: can be snapshot or wal\n* **replica**: always S3 in this version\n* **generation**: backup generation ID\n* **index**: backup index ID\n* **offset**: backup offset\n* **size**: backup size in bytes\n* **created**: backup creation date and time\n\n### Example\n\n```bash\n> LIST BACKUPS DATABASE db1.sqlite\n----------|---------|------------------|-------|--------|------|----------------------|\n type | replica | generation | index | offset | size | created |\n----------|---------|------------------|-------|--------|------|----------------------|\n snapshot | s3 | 6283e07babc9aff1 | 0 | NULL | 797 | 2023-02-01T14:51:24Z |\n wal | s3 | 6283e07babc9aff1 | 0 | 0 | 119 | 2023-02-01T14:51:24Z |\n wal | s3 | 6283e07babc9aff1 | 0 | 4152 | 493 | 2023-02-06T15:46:32Z |\n wal | s3 | 6283e07babc9aff1 | 1 | 0 | 119 | 2023-02-06T15:46:33Z |\n wal | s3 | 6283e07babc9aff1 | 1 | 4152 | 386 | 2023-02-06T15:47:44Z |\n wal | s3 | 6283e07babc9aff1 | 2 | 0 | 119 | 2023-02-06T15:47:44Z |\n wal | s3 | 6283e07babc9aff1 | 2 | 4152 | 386 | 2023-02-06T15:48:20Z |\n wal | s3 | 6283e07babc9aff1 | 3 | 0 | 119 | 2023-02-06T15:48:45Z |\n wal | s3 | 6283e07babc9aff1 | 3 | 4152 | 386 | 2023-02-06T15:48:55Z |\n wal | s3 | 6283e07babc9aff1 | 3 | 8272 | 386 | 2023-02-06T15:49:28Z |\n wal | s3 | 6283e07babc9aff1 | 4 | 0 | 119 | 2023-02-06T15:49:45Z |\n wal | s3 | 6283e07babc9aff1 | 4 | 4152 | 386 | 2023-02-06T15:53:30Z |\n wal | s3 | 6283e07babc9aff1 | 5 | 0 | 119 | 2023-02-06T15:53:30Z |\n wal | s3 | 6283e07babc9aff1 | 5 | 4152 | 386 | 2023-02-06T15:53:52Z |\n wal | s3 | 6283e07babc9aff1 | 6 | 0 | 115 | 2023-02-06T15:54:31Z |\n snapshot | s3 | b866f7b3be9557d1 | 0 | NULL | 799 | 2023-02-07T17:39:46Z |\n wal | s3 | b866f7b3be9557d1 | 0 | 0 | 119 | 2023-02-07T17:39:46Z |\n snapshot | s3 | 1131237b6da7ae81 | 0 | NULL | 799 | 2023-02-07T19:25:15Z |\n wal | s3 | 1131237b6da7ae81 | 0 | 0 | 119 | 2023-02-07T19:25:15Z |\n----------|---------|------------------|-------|--------|------|----------------------|\n```\n\n## LIST BACKUPS\n\nThe LIST BACKUPS command returns a rowset containing information about which databases have enabled backup.\n\n### Syntax\n\nLIST BACKUPS\n\n### Privileges\n\n```\nBACKUP\n```\n\n### Return\n\nA Rowset with a single **name** column that returns all the databases with backup enabled.\n\n### Example\n\n```bash\n> LIST BACKUPS\n--------------------|\n name |\n--------------------|\n chinook-enc.sqlite |\n chinook.sqlite |\n db1.sqlite |\n dbempty.sqlite |\n encdb.sqlite |\n encdb2.sqlite |\n--------------------|\n```\n\n## RESTORE BACKUP DATABASE\n\nStarting from the information returned by the `LIST BACKUP DATABASE` command, you can restore a database with the RESTORE BACKUP DATABASE command. During a RESTORE, the database **database_name** will not be available. The TIMESTAMP option is usually used to restore a specific database back in time, but the GENERATION and INDEX options can also be used.\n\n### Syntax\nRESTORE BACKUP DATABASE **database_name** [GENERATION **generation**] [INDEX **index**] [TIMESTAMP **timestamp**]\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Privileges\n\n```\nRESTORE\n```\n\n## Example\n\n```bash\n> RESTORE BACKUP DATABASE db1.sqlite TIMESTAMP 2023-02-06T15:53:30Z\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/backup-commands.mdx","digest":"40a5f2d8dafd6f2d","deferredRender":true,"collection":"docs"}},{"title":"Cluster","filePath":"cluster-commands","type":"inner","level":1,"entry":{"id":"cluster-commands","data":{"title":"Cluster Commands","description":"Cluster commands are used to manage the cluster environment, such as listing nodes, getting the leader node, and transferring leadership to a specific node.","customClass":"","category":"reference","status":"publish"},"body":"## GET LEADER\nIn a cluster environment, the GET LEADER command returns the IP address and port of the Raft leader node. If the ID parameter is specified, then the nodeID of the leader node is returned.\n\n### Syntax\n\nGET LEADER [ID]\n\n### Privileges\n\n```\nCLUSTERADMIN, CLUSTERMONITOR\n```\n\n### Return\n\nA String containing the IP address and port of the leader.\nIf the ID parameter is specified then the Integer nodeID of the leader node is returned.\n\n### Example\n\n```bash\n> GET LEADER\n192.168.1.1:8860\n\n> GET LEADER ID\n3\n```\n\n## LIST NODES\n\nThe LIST NODES command returns a rowset with information about all the nodes that compose the cluster environment. In addition to static information, this command also reports up-to-date information about the Raft status of each node.\n\n### Syntax\n\nLIST NODES\n\n### Privileges\n\n```\nCLUSTERADMIN, CLUSTERMONITOR\n```\n\n### Return\n\nA Rowset with the following columns:\n* **id**: node ID\n* **node**: public node DNS name and port\n* **cluster**: DNS name and port used for Raft intra-node communication\n* **status**: Follower or Leader\n* **progress**: Probe, Replicate, Snapshot or Unknown\n* **match**: Raft log ID\n* **last_activity**: last activity date and time\n\n### Example\n\n```bash\n> LIST NODES\n----|--------------------------|---------------------------|----------|-----------|-------|---------------------|\n id | node | cluster | status | progress | match | last_activity |\n----|--------------------------|---------------------------|----------|-----------|-------|---------------------|\n 1 | dev1.sqlitecloud.io:9960 | dev1.sqlitecloud.io:10960 | Follower | Replicate | 13463 | 2023-02-08 08:17:08 |\n 2 | dev2.sqlitecloud.io:9960 | dev2.sqlitecloud.io:10960 | Leader | Replicate | 13463 | 2023-02-08 08:17:08 |\n 3 | dev3.sqlitecloud.io:9960 | dev3.sqlitecloud.io:10960 | Follower | Replicate | 13463 | 2023-02-08 08:17:08 |\n----|--------------------------|---------------------------|----------|-----------|-------|---------------------|\n\n```\n\n## TRANSFER LEADERSHIP TO NODE\n\nThe TRANSFER LEADERSHIP TO NODE command is rarely used (primarily for debugging purposes), but it can force Raft to change its leader node to a specific nodeid. The leader node is responsible for all the write operations, so it is wise to force the most powerful node to be the leader of a Raft cluster.\n\n### Syntax\n\nTRANSFER LEADERSHIP TO NODE **nodeid**\n\n### Privileges\n\n```\nCLUSTERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> GET LEADER ID\n1\n\n> TRANSFER LEADERSHIP TO NODE 3\nOK\n\n> GET LEADER ID\n3\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/cluster-commands.mdx","digest":"a0b927a27ed81ff1","deferredRender":true,"collection":"docs"}},{"title":"Database","filePath":"database-commands","type":"inner","level":1,"entry":{"id":"database-commands","data":{"title":"Database Commands","description":"Database commands are used to manage databases, such as creating, removing, and listing databases.","customClass":"","category":"reference","status":"publish"},"body":"## CREATE DATABASE\n\nThe CREATE DATABASE command physically creates a new SQLite database using the name specified in the database_name parameter. OK is returned if another database with the same name exists, and the clause IF NOT EXISTS is specified. Otherwise, the correct error is generated.\n\nYou can supply additional optional parameters to the command:\n* The KEY parameter creates a new AES-256 encrypted database with the encryption key specified in **encryption_key**.\n* The ENCODING parameter can specify the encoding of the newly created database (default is UTF-8). Allowed values are UTF-8, UTF-16, UTF-16le or UTF-16be. Once an encoding is set for a database, it cannot be changed.\n* The PAGESIZE parameter specifies the page size of the newly created database (at the time of writing, the default value is 4096). The page size must be a power of two between 512 and 65536 inclusive.\n\n### Syntax\n\nCREATE DATABASE **database_name** [KEY **encryption_key**] [ENCODING **encoding_value**] [PAGESIZE **pagesize_value**] [IF NOT EXISTS]\n\n### Privileges\n\n```\nCREATE_DATABASE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> CREATE DATABASE test.sqlite\nOK\n\n> USE DATABASE test.sqlite\nOK\n\n```\n\n## DECRYPT DATABASE\n\nThe DECRYPT DATABASE command removes encryption from a previously AES-256 encrypted database.\n\n### Syntax\n\nDECRYPT DATABASE **database_name**\n\n### Privileges\n\n```\nCREATE_DATABASE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> DECRYPT DATABASE test.sqlite\nOK\n```\n\n## DISABLE DATABASE\n\nUse this command to disable a database. Established connections will continue to have that database in use. The disabled database affects only new connections.\n\n### Syntax\n\nDISABLE DATABASE **database_name**\n\n### Privileges\n\n```\nDBADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> DISABLE DATABASE test.sqlite\nOK\n```\n\n## ENCRYPT DATABASE\n\nThe ENCRYPT DATABASE command adds an AES-256 encryption to an existing database. If the database was previously encrypted with another key, it is re-encrypted with the new key. Rekeying requires that every database file page be read, decrypted, re-encrypted with the new key, then written out again. Consequently, rekeying can take a long time on a larger database.\n\n### Syntax\n\nENCRYPT DATABASE **database_name** KEY **encryption_key**\n\n### Privileges\n\n```\nCREATE_DATABASE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> ENCRYPT DATABASE test.sqlite KEY adkkhadsj-uidsaoiudsa-hdsadsakj\nOK\n```\n\n## GET DATABASE\n\nUse this command to retrieve information about the currently used database. **key** parameter can be ID, SIZE, and NAME (default if **key** is not specified).\n\n### Syntax\n\nGET DATABASE **[key]**\n\n### Privileges\n\n```\nHOSTADMIN\n```\n\n### Return\n\nAn Integer if **key** is ID or SIZE.\nA String if **key** is NAME.\n\n### Example\n\n```bash\n> GET DATABASE ID\n9\n\n> GET DATABASE SIZE\n921600\n\n> GET DATABASE NAME\nmediastore.sqlite\n\n> GET DATABASE\nmediastore.sqlite\n\n```\n\n## LIST DATABASE KEYS\n\nThe LIST DATABASE KEYS command returns a list of settings for the **database_name** database.\n\n### Syntax\n\nLIST DATABASE **database_name** KEYS\n\n### Privileges\n\n```\nPRAGMA\n```\n\n### Return\n\nA Rowset with the following columns:\n* **key**: database key\n* **value**:database value\n\n### Example\n\n```bash\n> LIST DATABASE mediastore.sqlite KEYS\n-----|-------|\n key | value |\n-----|-------|\n k1 | v1 |\n-----|-------|\n\n```\n\n## LIST DATABASES\n\nThe LIST DATABASES command return information and statistics about the databases currently available on the server.\n\n### Syntax\n\nLIST DATABASES [DETAILED]\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nA Rowset with only the column **name** if the DETAILED flag is omitted, otherwise several other columns:\n* **name**: database name\n* **size**: database size (in bytes)\n* **connections**: number of clients connected to the database\n* **encryption**: encryption algorithm (if any)\n* **backup**: 1 if database has backup enabled\n* **nread**: number of read operations\n* **nwrite**: number of write operations\n* **inbytes**: number of bytes received\n* **outbytes**: number of bytes sent\n* **fragmentation**: a number between 0 and 1 that represents the database fragmentation\n* **pagesize**: database default page size\n* **encoding**: database default encoding\n* **status**: database status (1 = OK, 2 = DISABLED, 3 = MAINTENANCE, 4 = ERROR)\n\n### Example\n\n```bash\n> LIST DATABASES DETAILED\n--------------------------|-----------|-------------|------------|--------|-------|--------|---------|----------|---------------|----------|----------|--------|\n name | size | connections | encryption | backup | nread | nwrite | inbytes | outbytes | fragmentation | pagesize | encoding | status |\n--------------------------|-----------|-------------|------------|--------|-------|--------|---------|----------|---------------|----------|----------|--------|\n 555.sqlite | 104992768 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.00 | 4096 | UTF-8 | 1 |\n cli-test-1.sqlite | 12288 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.33 | 4096 | UTF-8 | 1 |\n cli-test-2.sqlite | 12288 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.33 | 4096 | UTF-8 | 1 |\n images.sqlite | 11409408 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.00 | 1024 | UTF-8 | 1 |\n mediastore.sqlite | 921600 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.00 | 4096 | UTF-8 | 1 |\n multiple-commands.sqlite | 12288 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.33 | 4096 | UTF-8 | 1 |\n numbers.sqlite | 12288 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.00 | 4096 | UTF-8 | 1 |\n pluto.sqlite | 4246528 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.00 | 1024 | UTF-8 | 1 |\n test.sqlite | 32768 | 0 | NULL | 0 | 0 | 0 | 0 | 0 | 0.12 | 4096 | UTF-8 | 1 |\n--------------------------|-----------|-------------|------------|--------|-------|--------|---------|----------|---------------|----------|----------|--------|\n\n```\n\n## LIST DATABASE CONNECTIONS\n\nThe LIST DATABASE CONNECTIONS command retrieves a list of all clients connected to that specific database (connected means a connection who sent a USE DATABASE command). The **database_name** parameter can also be a database_id if the ID flag is specified.\n\n### Syntax\n\nLIST DATABASE **database_name** CONNECTIONS [ID]\n\n### Privileges\n\n```\nHOSTADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **id**: client ID\n* **address**: client IP address\n* **username**: username of the connected client\n* **database**: database name\n* **connection_date**: connection initial date/time (in UTC format)\n* **last_activity**: last client activity\n\n### Example\n\n```bash\n> USE DATABASE mediastore.sqlite\nOK\n\n> LIST DATABASE mediastore.sqlite CONNECTIONS\n----|-----------|----------|-------------------|---------------------|---------------------|\n id | address | username | database | connection_date | last_activity |\n----|-----------|----------|-------------------|---------------------|---------------------|\n 1 | 127.0.0.1 | admin | mediastore.sqlite | 2023-02-14 16:00:52 | 2023-02-14 16:01:10 |\n----|-----------|----------|-------------------|---------------------|---------------------|\n```\n\n## REMOVE DATABASE\n\nThe REMOVE DATABASE command permanently deletes a database from the cluster.\n\n### Syntax\n\nREMOVE DATABASE **database_name** [IF EXISTS]\n\n### Privileges\n\n```\nDROP_DATABASE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE DATABASE mediastore.sqlite\nOK\n```\n\n## USE DATABASE\n\nThe USE DATABASE statement tells SQLite Cloud to use the named database as the default (current) database for subsequent SQL statements.\n\n### Syntax\n\nUSE DATABASE **database_name**\n\n### Privileges\n\n```\nPRIVILEGE_DBADMIN or PRIVILEGE_PUBSUB, which means that the USE DATABASE command succeeds if any of the following Privileges is set: PRIVILEGE_READ, PRIVILEGE_INSERT, RIVILEGE_UPDATE, PRIVILEGE_DELETE, PRIVILEGE_PRAGMA, PRIVILEGE_CREATE_TABLE, PRIVILEGE_CREATE_INDEX, PRIVILEGE_CREATE_VIEW, PRIVILEGE_CREATE_TRIGGER, PRIVILEGE_DROP_TABLE, PRIVILEGE_DROP_INDEX, PRIVILEGE_DROP_VIEW, PRIVILEGE_DROP_TRIGGER, PRIVILEGE_ALTER_TABLE, PRIVILEGE_ANALYZE, PRIVILEGE_ATTACH, PRIVILEGE_DETACH PRIVILEGE_SUB, PRIVILEGE_PUB\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> USE DATABASE test.sqlite\nOK\n```\n\n## UNUSE DATABASE\n\nThe UNUSE DATABASE statement tells SQLite Cloud to close the connection with the currently used database (previously set by a USE DATABASE statement). No error is returned if the current connection has no database set.\n\n### Syntax\n\nUNUSE DATABASE\n\n### Privileges\n\n```\nREADWRITE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> USE DATABASE test.sqlite\nOK\n\n> UNUSE DATABASE\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/database-commands.mdx","digest":"7bac058564050af9","deferredRender":true,"collection":"docs"}},{"title":"General Info","filePath":"general-commands","type":"inner","level":1,"entry":{"id":"general-commands","data":{"title":"General Info Commands","description":"These commands provide general information about the server, such as the version, the number of databases, and the number of active connections.","customClass":"","category":"reference","status":"publish"},"body":"## CLOSE CONNECTION\n\nThe CLOSE CONNECTION command closes the connection identified by the parameter connectionid. An optional NODE argument can be specified to force close a connection into the specified nodeid. The LIST CONNECTIONS command can be used to obtain a list of currently connected connection id(s).\n\n### Syntax\n\nCLOSE CONNECTION **connectionid** [NODE **nodeid**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> LIST CONNECTION\n----|-----------|----------|----------|---------------------|---------------------|\n id | address | username | database | connection_date | last_activity |\n----|-----------|----------|----------|---------------------|---------------------|\n 1 | 127.0.0.1 | admin | NULL | 2023-02-03 10:08:20 | 2023-02-06 13:26:48 |\n----|-----------|----------|----------|---------------------|---------------------|\n\n> CLOSE CONNECTION 1\nOK\n```\n\n## GET INFO\n\nThe GET INFO command retrieves a single specific information about a **key**. The NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nGET INFO **key** [NODE **nodeid**]\n\n### Privileges\n\n```\nCLUSTERADMIN, CLUSTERMONITOR\n```\n\n### Return\n\nA single value (usually a String) that depends on the input **key**.\n\n### Example\n\n```bash\n> GET INFO sqlitecloud_version\n0.9.8\n```\n\n## GET SQL\n\nThe GET SQL command retrieves the SQL statement used to generate the **table_name**.\n\n### Syntax\n\nGET SQL **table_name**\n\n### Privileges\n\n```\nREADWRITE\n```\n\n### Return\n\nA String set to the CREATE TABLE sql statement.\n\n### Example\n\n```bash\n> GET SQL table1\nCREATE TABLE table1 (id INTEGER PRIMARY KEY, name TEXT, surname TEXT, age INTEGER);\n```\n\n## LIST COMMANDS\n\nThe LIST COMMANDS command returns a list of all supported built-in commands. It also returns information about how often each command was executed on the average execution time. The DETAILED flag adds a privileges column to the result.\n\n### Syntax\n\nLIST COMMANDS [DETAILED]\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nA Rowset with the following columns:\n* **command**: command syntax\n* **count**: how many times the command was executed\n* **avgtime**: average command execution time\n\n### Example\n\n```bash\n> LIST COMMANDS\n----------------------------------------------------------------------|-------|---------|\n command | count | avgtime |\n----------------------------------------------------------------------|-------|---------|\n DECRYPT DATABASE | 0 | 0.0 |\n DISABLE DATABASE | 0 | 0.0 |\n DISABLE PLUGIN | 0 | 0.0 |\n DISABLE USER | 0 | 0.0 |\n DROP APIKEY | 0 | 0.0 |\n DROP CHANNEL | 0 | 0.0 |\n DROP CLIENT KEY | 0 | 0.0 |\n DROP DATABASE KEY | 0 | 0.0 |\n DROP DATABASE [IF EXISTS] | 0 | 0.0 |\n DROP KEY | 0 | 0.0 |\n DROP ROLE | 0 | 0.0 |\n DROP USER | 0 | 0.0 |\n ENABLE DATABASE | 0 | 0.0 |\n ENABLE PLUGIN | 0 | 0.0 |\n ENABLE USER | 0 | 0.0 |\n ENCRYPT DATABASE WITH KEY | 0 | 0.0 |\n GET CLIENT KEY | 0 | 0.0 |\n GET DATABASE KEY | 0 | 0.0 |\n GET DATABASE [] | 0 | 0.0 |\n GET INFO [NODE ] | 0 | 0.0 |\n GET KEY | 0 | 0.0 |\n GET LEADER [ID] | 0 | 0.0 |\n GET RUNTIME KEY | 0 | 0.0 |\n GET SQL | 0 | 0.0 |\n GET USER | 0 | 0.0 |\n ---------------------------------------------------------------------|-------|---------|\n```\n\n## LIST CONNECTIONS\n\nThe LIST CONNECTIONS command returns information about the client connections server. The NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nLIST CONNECTIONS [NODE **nodeid**]\n\n### Privileges\n\n```\nUSERADMIN, HOSTADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **id**: unique connection (client) ID\n* **address**: source connection IP address\n* **username**: username used to authenticate the connection\n* **connection_date**: original connection date and time\n* **last_activity**: last activity date and time\n* **address**: source connection IP address\n\n### Example\n\n```bash\n> LIST CONNECTIONS\n----|-----------|----------|----------|---------------------|---------------------|\n id | address | username | database | connection_date | last_activity |\n----|-----------|----------|----------|---------------------|---------------------|\n 1 | 127.0.0.1 | admin | NULL | 2023-02-08 15:28:32 | 2023-02-08 15:34:51 |\n----|-----------|----------|----------|---------------------|---------------------|\n\n```\n\n## LIST INDEXES\n\nThe LIST INDEXES command returns a list of all indexes defined inside the currently used database.\n\n### Syntax\n\nLIST INDEXES\n\n### Privileges\n\n```\nREADWRITE\n```\n\n### Return\n\nA Rowset with the following columns:\n* **name**: index name\n* **tbl_name**: table name\n\n### Example\n\n```bash\n> LIST INDEXES\n--------------------------|---------------|\n name | tbl_name |\n--------------------------|---------------|\n IFK_AlbumArtistId | Album |\n IFK_CustomerSupportRepId | Customer |\n IFK_EmployeeReportsTo | Employee |\n IFK_InvoiceCustomerId | Invoice |\n IFK_InvoiceLineInvoiceId | InvoiceLine |\n IFK_InvoiceLineTrackId | InvoiceLine |\n IFK_PlaylistTrackTrackId | PlaylistTrack |\n IFK_TrackAlbumId | Track |\n IFK_TrackGenreId | Track |\n IFK_TrackMediaTypeId | Track |\n--------------------------|---------------|\n```\n\n## LIST INFO\n\nThe LIST INFO command retrieves general information about the server. To retrieve a single specific information, use the GET INFO **key** command.\n\n### Syntax\n\nLIST INFO\n\n### Privileges\n\n```\nCLUSTERADMIN, CLUSTERMONITOR\n```\n\n### Return\n\nA Rowset with the following columns:\n* **key**: server key\n* **value**: server value\n\n### Example\n\n```bash\n> LIST INFO\n--------------------------|------------------------------------------|\n key | value |\n--------------------------|------------------------------------------|\n sqlitecloud_version | 0.9.8 |\n sqlite_version | 3.39.3 |\n sqlitecloud_build_date | Feb 10 2023 |\n sqlitecloud_git_hash | 9239313dc085cb787d25cf79424cefcf8ad17401 |\n os | macOS 13.2 (22D49) |\n arch_bits | 64bit |\n multiplexing_api | kqueue |\n listening_port | 8860 |\n process_id | 64750 |\n num_processors | 10 |\n startup_datetime | 2023-02-10 14:36:37 |\n current_datetime | 2023-02-10 14:36:45 |\n nocluster | 1 |\n nodeid | 0 |\n load | 0.0021821100438153 |\n num_clients | 1 |\n running_clients | 1 |\n max_fd | 15824 |\n num_fd | 35 |\n mem_current | 1729952 |\n mem_max | 1840272 |\n mem_total | 17179869184 |\n disk_total | 494384795648 |\n disk_free | 296209416192 |\n disk_usage | 198175379456 |\n disk_usage_perc | 40.0852496275189 |\n cpu_load | 0.4262 |\n num_connections | 1 |\n max_connections | 10000 |\n tls | LibreSSL 3.6.1 |\n tls_conn_version | TLSv1.3 |\n tls_conn_cipher | TLS_CHACHA20_POLY1305_SHA256 |\n tls_conn_cipher_strength | 256 |\n tls_conn_alpn_selected | NULL |\n tls_conn_servername | localhost |\n tls_peer_cert_provided | 0 |\n tls_peer_cert_subject | NULL |\n tls_peer_cert_issuer | NULL |\n tls_peer_cert_hash | NULL |\n tls_peer_cert_notbefore | NULL |\n tls_peer_cert_notafter | NULL |\n--------------------------|------------------------------------------|\n```\n\n## LIST KEYWORDS\n\nThe LIST KEYWORDS command returns a rowset that contains a list of SQLite reserved keywords.\n\n### Syntax\n\nLIST KEYWORDS\n\n### Privileges\n\n```\nREADWRITE, DBADMIN\n```\n\n### Return\n\nA Rowset with one **key** column that returns all the reserved SQLite keywords.\n\n### Example\n\n```bash\n> LIST KEYWORDS\n-------------------|\n key |\n-------------------|\n REINDEX |\n INDEXED |\n INDEX |\n DESC |\n ESCAPE |\n EACH |\n CHECK |\n KEY |\n BEFORE |\n FOREIGN |\n FOR |\n IGNORE |\n REGEXP |\n EXPLAIN |\n INSTEAD |\n ADD |\n DATABASE |\n AS |\n SELECT |\n TABLE |\n LEFT |\n THEN |\n END |\n DEFERRABLE |\n ELSE |\n EXCLUDE |\n DELETE |\n TEMPORARY |\n TEMP |\n OR |\n ISNULL |\n NULLS |\n SAVEPOINT |\n INTERSECT |\n TIES |\n NOTNULL |\n NOT |\n NO |\n NULL |\n LIKE |\n EXCEPT |\n TRANSACTION |\n ACTION |\n ON |\n NATURAL |\n ALTER |\n RAISE |\n EXCLUSIVE |\n EXISTS |\n CONSTRAINT |\n INTO |\n OFFSET |\n OF |\n SET |\n TRIGGER |\n RANGE |\n GENERATED |\n DETACH |\n HAVING |\n GLOB |\n BEGIN |\n INNER |\n REFERENCES |\n UNIQUE |\n QUERY |\n WITHOUT |\n WITH |\n OUTER |\n RELEASE |\n ATTACH |\n BETWEEN |\n NOTHING |\n GROUPS |\n GROUP |\n CASCADE |\n ASC |\n DEFAULT |\n CASE |\n COLLATE |\n CREATE |\n CURRENT_DATE |\n IMMEDIATE |\n JOIN |\n INSERT |\n MATCH |\n PLAN |\n ANALYZE |\n PRAGMA |\n MATERIALIZED |\n DEFERRED |\n DISTINCT |\n IS |\n UPDATE |\n VALUES |\n VIRTUAL |\n ALWAYS |\n WHEN |\n WHERE |\n RECURSIVE |\n ABORT |\n AFTER |\n RENAME |\n AND |\n DROP |\n PARTITION |\n AUTOINCREMENT |\n TO |\n IN |\n CAST |\n COLUMN |\n COMMIT |\n CONFLICT |\n CROSS |\n CURRENT_TIMESTAMP |\n CURRENT_TIME |\n CURRENT |\n PRECEDING |\n FAIL |\n LAST |\n FILTER |\n REPLACE |\n FIRST |\n FOLLOWING |\n FROM |\n FULL |\n LIMIT |\n IF |\n ORDER |\n RESTRICT |\n OTHERS |\n OVER |\n RETURNING |\n RIGHT |\n ROLLBACK |\n ROWS |\n ROW |\n UNBOUNDED |\n UNION |\n USING |\n VACUUM |\n VIEW |\n WINDOW |\n DO |\n BY |\n INITIALLY |\n ALL |\n PRIMARY |\n-------------------|\n```\n\n## LIST METADATA\n\nThe LIST METADATA command retrieves detailed information about the internal structure of a table. The information returned can be further restricted by specifying a **table_name** and/or a **column_name**.\n\n### Syntax\n\nLIST METADATA [TABLE **table_name**] [COLUMN **column_name**]\n\n### Privileges\n\n```\nREADWRITE\n```\n\n### Return\n\nA Rowset with several columns that depends on the filters used in the command. The output is similar to the one obtains by calling the sqlite3_table_column_metadata API.\n\n### Example\n\n```bash\n> LIST METADATA\n-------------------|---------------|---------|----------|-------------|----------|---------------|---------------|\n name | data_type | col_seq | not_null | primary_key | auto_inc | tablename | affinity_type |\n-------------------|---------------|---------|----------|-------------|----------|---------------|---------------|\n TrackId | INTEGER | BINARY | 1 | 1 | 0 | Track | 1 |\n Name | NVARCHAR(200) | BINARY | 1 | 0 | 0 | Track | 3 |\n AlbumId | INTEGER | BINARY | 0 | 0 | 0 | Track | 1 |\n MediaTypeId | INTEGER | BINARY | 1 | 0 | 0 | Track | 1 |\n GenreId | INTEGER | BINARY | 0 | 0 | 0 | Track | 1 |\n Composer | NVARCHAR(220) | BINARY | 0 | 0 | 0 | Track | 3 |\n Milliseconds | INTEGER | BINARY | 1 | 0 | 0 | Track | 1 |\n Bytes | INTEGER | BINARY | 0 | 0 | 0 | Track | 1 |\n UnitPrice | NUMERIC(10,2) | BINARY | 1 | 0 | 0 | Track | 3 |\n PlaylistId | INTEGER | BINARY | 1 | 1 | 0 | PlaylistTrack | 1 |\n TrackId | INTEGER | BINARY | 1 | 1 | 0 | PlaylistTrack | 1 |\n PlaylistId | INTEGER | BINARY | 1 | 1 | 0 | Playlist | 1 |\n Name | NVARCHAR(120) | BINARY | 0 | 0 | 0 | Playlist | 3 |\n ArtistId | INTEGER | BINARY | 1 | 1 | 0 | Artist | 1 |\n Name | NVARCHAR(120) | BINARY | 0 | 0 | 0 | Artist | 3 |\n CustomerId | INTEGER | BINARY | 1 | 1 | 0 | Customer | 1 |\n FirstName | NVARCHAR(40) | BINARY | 1 | 0 | 0 | Customer | 3 |\n LastName | NVARCHAR(20) | BINARY | 1 | 0 | 0 | Customer | 3 |\n Company | NVARCHAR(80) | BINARY | 0 | 0 | 0 | Customer | 3 |\n Address | NVARCHAR(70) | BINARY | 0 | 0 | 0 | Customer | 3 |\n City | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Customer | 3 |\n State | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Customer | 3 |\n Country | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Customer | 3 |\n PostalCode | NVARCHAR(10) | BINARY | 0 | 0 | 0 | Customer | 3 |\n Phone | NVARCHAR(24) | BINARY | 0 | 0 | 0 | Customer | 3 |\n Fax | NVARCHAR(24) | BINARY | 0 | 0 | 0 | Customer | 3 |\n Email | NVARCHAR(60) | BINARY | 1 | 0 | 0 | Customer | 3 |\n SupportRepId | INTEGER | BINARY | 0 | 0 | 0 | Customer | 1 |\n EmployeeId | INTEGER | BINARY | 1 | 1 | 0 | Employee | 1 |\n LastName | NVARCHAR(20) | BINARY | 1 | 0 | 0 | Employee | 3 |\n FirstName | NVARCHAR(20) | BINARY | 1 | 0 | 0 | Employee | 3 |\n Title | NVARCHAR(30) | BINARY | 0 | 0 | 0 | Employee | 3 |\n ReportsTo | INTEGER | BINARY | 0 | 0 | 0 | Employee | 1 |\n BirthDate | DATETIME | BINARY | 0 | 0 | 0 | Employee | 3 |\n HireDate | DATETIME | BINARY | 0 | 0 | 0 | Employee | 3 |\n Address | NVARCHAR(70) | BINARY | 0 | 0 | 0 | Employee | 3 |\n City | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Employee | 3 |\n State | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Employee | 3 |\n Country | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Employee | 3 |\n PostalCode | NVARCHAR(10) | BINARY | 0 | 0 | 0 | Employee | 3 |\n Phone | NVARCHAR(24) | BINARY | 0 | 0 | 0 | Employee | 3 |\n Fax | NVARCHAR(24) | BINARY | 0 | 0 | 0 | Employee | 3 |\n Email | NVARCHAR(60) | BINARY | 0 | 0 | 0 | Employee | 3 |\n GenreId | INTEGER | BINARY | 1 | 1 | 0 | Genre | 1 |\n Name | NVARCHAR(120) | BINARY | 0 | 0 | 0 | Genre | 3 |\n InvoiceId | INTEGER | BINARY | 1 | 1 | 0 | Invoice | 1 |\n CustomerId | INTEGER | BINARY | 1 | 0 | 0 | Invoice | 1 |\n InvoiceDate | DATETIME | BINARY | 1 | 0 | 0 | Invoice | 3 |\n BillingAddress | NVARCHAR(70) | BINARY | 0 | 0 | 0 | Invoice | 3 |\n BillingCity | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Invoice | 3 |\n BillingState | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Invoice | 3 |\n BillingCountry | NVARCHAR(40) | BINARY | 0 | 0 | 0 | Invoice | 3 |\n BillingPostalCode | NVARCHAR(10) | BINARY | 0 | 0 | 0 | Invoice | 3 |\n Total | NUMERIC(10,2) | BINARY | 1 | 0 | 0 | Invoice | 3 |\n AlbumId | INTEGER | BINARY | 1 | 1 | 0 | Album | 1 |\n Title | NVARCHAR(160) | BINARY | 1 | 0 | 0 | Album | 3 |\n ArtistId | INTEGER | BINARY | 1 | 0 | 0 | Album | 1 |\n InvoiceLineId | INTEGER | BINARY | 1 | 1 | 0 | InvoiceLine | 1 |\n InvoiceId | INTEGER | BINARY | 1 | 0 | 0 | InvoiceLine | 1 |\n TrackId | INTEGER | BINARY | 1 | 0 | 0 | InvoiceLine | 1 |\n UnitPrice | NUMERIC(10,2) | BINARY | 1 | 0 | 0 | InvoiceLine | 3 |\n Quantity | INTEGER | BINARY | 1 | 0 | 0 | InvoiceLine | 1 |\n MediaTypeId | INTEGER | BINARY | 1 | 1 | 0 | MediaType | 1 |\n Name | NVARCHAR(120) | BINARY | 0 | 0 | 0 | MediaType | 3 |\n-------------------|---------------|---------|----------|-------------|----------|---------------|---------------|\n\n> LIST METADATA TABLE Track\n--------------|---------------|---------|----------|-------------|----------|\n name | data_type | col_seq | not_null | primary_key | auto_inc |\n--------------|---------------|---------|----------|-------------|----------|\n TrackId | INTEGER | BINARY | 1 | 1 | 0 |\n Name | NVARCHAR(200) | BINARY | 1 | 0 | 0 |\n AlbumId | INTEGER | BINARY | 0 | 0 | 0 |\n MediaTypeId | INTEGER | BINARY | 1 | 0 | 0 |\n GenreId | INTEGER | BINARY | 0 | 0 | 0 |\n Composer | NVARCHAR(220) | BINARY | 0 | 0 | 0 |\n Milliseconds | INTEGER | BINARY | 1 | 0 | 0 |\n Bytes | INTEGER | BINARY | 0 | 0 | 0 |\n UnitPrice | NUMERIC(10,2) | BINARY | 1 | 0 | 0 |\n--------------|---------------|---------|----------|-------------|----------|\n```\n\n## LIST TABLES\n\nThe LIST TABLES command retrieves the information about the tables available inside the current database. Note that the output of this command can change depending on the privileges associated with the currently connected username. If the PUBSUB parameter is used, then the output will contain the column chname only (to have the same format as the rowset returned by the LIST CHANNELS command).\n\n### Syntax\n\nLIST TABLES [PUBSUB]\n\n### Privileges\n\n```\nREADWRITE\n```\n\n### Return\n\nA Rowset with the following columns:\n* **schema**: database schema name\n* **name**: table name\n* **type**: always 'table' in this version\n* **ncol**: number of columns\n* **wr**: without rowid flag\n* **name**: strict flag\n\nIf the PUBSUB option is used then a single **chname** column is returned (to produce the same output as the LIST CHANNELS command).\n\n### Example\n\n```bash\n> LIST TABLES\n--------|---------------|-------|------|----|--------|\n schema | name | type | ncol | wr | strict |\n--------|---------------|-------|------|----|--------|\n main | Track | table | 9 | 0 | 0 |\n main | PlaylistTrack | table | 2 | 0 | 0 |\n main | Playlist | table | 2 | 0 | 0 |\n main | Artist | table | 2 | 0 | 0 |\n main | Customer | table | 13 | 0 | 0 |\n main | Employee | table | 15 | 0 | 0 |\n main | Genre | table | 2 | 0 | 0 |\n main | Invoice | table | 9 | 0 | 0 |\n main | Album | table | 3 | 0 | 0 |\n main | InvoiceLine | table | 5 | 0 | 0 |\n main | MediaType | table | 2 | 0 | 0 |\n--------|---------------|-------|------|----|--------|\n```\n\n## LIST STATS\n\nThe LIST STATS command retrieves statistic information from the connected node (or from a specific **nodeid** if the NODE parameter is used). If no range date is specified with the FROM/TO parameters, then stats from the last hour are returned. If the MEMORY argument is used, then a new PHYSICAL_MEMORY key is added to the result.\n\n### Syntax\n\nLIST STATS [FROM **start_date** TO **end_date**] [NODE **nodeid**] [MEMORY]\n\n### Privileges\n\n```\nCLUSTERADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **datetime**: the data time of the stat\n* **key**: stat name\n* **value**: stat value\n\n### Example\n\n```bash\n> LIST STATS\n---------------------|-----------------|--------------------|\n datetime | key | value |\n---------------------|-----------------|--------------------|\n 2023-02-09 09:21:51 | BYTES_IN | 312 |\n 2023-02-09 09:21:51 | BYTES_OUT | 943 |\n 2023-02-09 09:21:51 | CPU_LOAD | 0.0185958557811852 |\n 2023-02-09 09:21:51 | CURRENT_CLIENTS | 1 |\n 2023-02-09 09:21:51 | CURRENT_MEMORY | 1640640 |\n 2023-02-09 09:21:51 | MAX_CLIENTS | 1 |\n 2023-02-09 09:21:51 | MAX_MEMORY | 1802512 |\n 2023-02-09 09:21:51 | NUM_COMMANDS | 7 |\n 2023-02-09 09:21:51 | NUM_READS | 0 |\n 2023-02-09 09:21:51 | NUM_WRITES | 0 |\n 2023-02-09 09:22:51 | BYTES_IN | 312 |\n 2023-02-09 09:22:51 | BYTES_OUT | 943 |\n 2023-02-09 09:22:51 | CPU_LOAD | 0.0184632834613829 |\n 2023-02-09 09:22:51 | CURRENT_CLIENTS | 1 |\n 2023-02-09 09:22:51 | CURRENT_MEMORY | 1640640 |\n 2023-02-09 09:22:51 | MAX_CLIENTS | 1 |\n 2023-02-09 09:22:51 | MAX_MEMORY | 1802512 |\n 2023-02-09 09:22:51 | NUM_COMMANDS | 7 |\n 2023-02-09 09:22:51 | NUM_READS | 0 |\n 2023-02-09 09:22:51 | NUM_WRITES | 0 |\n 2023-02-09 09:23:51 | BYTES_IN | 312 |\n 2023-02-09 09:23:51 | BYTES_OUT | 943 |\n 2023-02-09 09:23:51 | CPU_LOAD | 0.0184403868930122 |\n 2023-02-09 09:23:51 | CURRENT_CLIENTS | 1 |\n 2023-02-09 09:23:51 | CURRENT_MEMORY | 1640640 |\n 2023-02-09 09:23:51 | MAX_CLIENTS | 1 |\n 2023-02-09 09:23:51 | MAX_MEMORY | 1802512 |\n 2023-02-09 09:23:51 | NUM_COMMANDS | 7 |\n 2023-02-09 09:23:51 | NUM_READS | 0 |\n 2023-02-09 09:23:51 | NUM_WRITES | 0 |\n 2023-02-09 09:24:52 | BYTES_IN | 312 |\n 2023-02-09 09:24:52 | BYTES_OUT | 943 |\n 2023-02-09 09:24:52 | CPU_LOAD | 0.0183631842713955 |\n 2023-02-09 09:24:52 | CURRENT_CLIENTS | 1 |\n 2023-02-09 09:24:52 | CURRENT_MEMORY | 1640640 |\n 2023-02-09 09:24:52 | MAX_CLIENTS | 1 |\n 2023-02-09 09:24:52 | MAX_MEMORY | 1802512 |\n 2023-02-09 09:24:52 | NUM_COMMANDS | 7 |\n 2023-02-09 09:24:52 | NUM_READS | 0 |\n 2023-02-09 09:24:52 | NUM_WRITES | 0 |\n---------------------|-----------------|--------------------|\n```\n## PING\n\nThe PING command is provided to test whether a connection is still alive.\n\nThis command is also useful for:\n1. Verifying the server's ability to serve data - an error is returned when this isn't the case.\n2. Measuring latency.\n\n### Syntax\n\nPING\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nIt returns the \"PONG\" String. \n\n### Example\n\n```bash\n> PING\nPONG\n```\n\n## SLEEP\n\nThe SLEEP command forces the current connection to sleep on the server-side for a specified amount of milliseconds.\n\n### Syntax\n\nSLEEP **ms**\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SLEEP 100\nOK (after 100ms)\n```\n\n## TEST\n\nThe TEST command is used for debugging purposes and can be used by developers while developing the SCSP for a new language.\nBy specifying a different test_name, the server will reply with different responses so you can test the parsing capabilities of your new binding.\nSupported test_name are: STRING, STRING0, ZERO_STRING, ERROR, EXTERROR, INTEGER, FLOAT, BLOB, BLOB0, ROWSET, ROWSET_CHUNK, JSON, NULL, COMMAND, ARRAY, ARRAY0\n\n### Syntax\n\nTEST **test_name** [COMPRESSED]\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nDifferent output that depends on the **test_name** value.\n\n### Example\n\n```bash\n> TEST STRING\nHello World, this is a test string.\n\n> TEST ERROR\nERROR: This is a test error message with a devil error code. (66666 - -1)\n\n> TEST INTEGER\n123456\n\n> TEST FLOAT\n3.1415926\n\n> TEST ROWSET\n--------------------------|----------------------------------------------------|\n key | value |\n--------------------------|----------------------------------------------------|\n sqlitecloud_version | 0.9.8 |\n sqlite_version | 3.39.3 |\n sqlitecloud_build_date | Feb 7 2023 |\n sqlitecloud_git_hash | 24e2ec6b121f09313afa9dfa4c02e9c9cc372034 |\n os | Linux on x86_64 (Kernel version 5.15.0-58-generic) |\n arch_bits | 64bit |\n multiplexing_api | epool |\n listening_port | 9960 |\n process_id | 182275 |\n num_processors | 1 |\n startup_datetime | 2023-02-07 19:25:13 |\n current_datetime | 2023-02-08 09:31:23 |\n nocluster | 0 |\n nodeid | 1 |\n tls | LibreSSL 3.6.1 |\n tls_conn_version | TLSv1.3 |\n tls_conn_cipher | TLS_AES_256_GCM_SHA384 |\n tls_conn_cipher_strength | 256 |\n tls_conn_alpn_selected | NULL |\n tls_conn_servername | dev1.sqlitecloud.io |\n tls_peer_cert_provided | 0 |\n tls_peer_cert_subject | NULL |\n tls_peer_cert_issuer | NULL |\n tls_peer_cert_hash | NULL |\n tls_peer_cert_notbefore | NULL |\n tls_peer_cert_notafter | NULL |\n--------------------------|----------------------------------------------------|\n\n> TEST ARRAY\n[0] Hello World\n[1] 123456\n[2] 3.1415\n[3] NULL\n[4] BLOB size 10\n\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/general-commands.mdx","digest":"fc146eae7a6bf6c5","deferredRender":true,"collection":"docs"}},{"title":"IP","filePath":"ip-commands","type":"inner","level":1,"entry":{"id":"ip-commands","data":{"title":"IP Commands","description":"IP commands are used to manage the IP restrictions for users and roles.","customClass":"","category":"reference","status":"publish"},"body":"## ADD ALLOWED IP\n\nThe ADD ALLOWED IP command restricts access for the role or user by allowing only some IP addresses. Ranges in CIDR notation like 10.10.10.0/24 can be used. IPv4 and IPv6 addresses are supported.\n\n### Syntax\n\nADD ALLOWED IP **ip_address** [ROLE **role_name**] [USER **username**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> ADD ALLOWED IP 10.10.10.0/24 USER user1\nOK\n```\n\n## LIST ALLOWED IP\n\nThe LIST ALLOWED IP returns a rowset that contains all the IP restrictions associated with a given ROLE and/or USER. If no ROLE/USER is specified, then all the IP restrictions table is returned.\n\n### Syntax\n\nLIST ALLOWED IP [ROLE **role_name**] [USER **user_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **address**: IP address(es) allowed\n* **name**: user name or role name\n* **type**: user or role String\n\n### Example\n\n```bash\n> LIST ALLOWED IP\n------------|-------|------|\n address | name | type |\n------------|-------|------|\n192.168.1.1 | user1 | user |\n------------|-------|------|\n\n```\n\n## REMOVE ALLOWED IP\n\nThe REMOVE ALLOWED IP command permanently removes the **ip_address** from the list of allowed IPs. You can specify a ROLE and/or a USER to restrict the filter further.\n\n### Syntax\n\nREMOVE ALLOWED IP **ip_address** [ROLE **role_name**] [USER **username**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE ALLOWED IP 192.168.1.1\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/ip-commands.mdx","digest":"b977ad1f3d2ef709","deferredRender":true,"collection":"docs"}},{"title":"Logs","filePath":"log-commands","type":"inner","level":1,"entry":{"id":"log-commands","data":{"title":"Log Commands","description":"Log commands are used to retrieve the logs generated on the server side.","customClass":"","category":"reference","status":"publish"},"body":"## LIST LOG\n\nThe LIST LOG command is used to retrieve the logs generated on server side. Logs can contain a huge number of entries. That's the reason why this command has so many filter options.\nThe FROM/TO dates restrict the query to a specific date range.\n\nThe LEVEL integer argument specifies the log details we are interested in. Possible options are: \n* LOG_LEVEL_PANIC = 0 (used in Raft)\n* LOG_LEVEL_FATAL = 1\n* LOG_LEVEL_ERROR = 2\n* LOG_LEVEL_WARNING = 3\n* LOG_LEVEL_INFO = 4\n* LOG_LEVEL_DEBUG = 5\n\nThe TYPE integer argument should specify the log type we are interested in. Possible values are:\n* LOG_TYPE_INTERNAL = 1, // internally generated by the server\n* LOG_TYPE_SECURITY = 2, // security issues\n* LOG_TYPE_SQL = 3, // log all SQL commands\n* LOG_TYPE_COMMAND = 4, // log all built-in commands\n* LOG_TYPE_RAFT = 5, // log related to Raft\n* LOG_TYPE_CLUSTER = 6, // log related to Cluster\n* LOG_TYPE_PLUGIN = 7, // log generated by a plugin\n* LOG_TYPE_CLIENT = 8 // log related to a client\n\nThe ID option instructs the rowset to add the unique ID column to the rowset.\nThe LIMIT option sets a maximum number of rows to return.\nThe CURSOR option is used to paginate and navigate the rowset.\nThe NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nLIST LOG [FROM **start_date**] [TO **end_date**] [LEVEL **log_level**] [TYPE **log_type**] [ID] [LIMIT **count**] [CURSOR **cursorid**] [NODE **nodeid**]\n\n### Privileges\n\n```\nHOSTADMIN\n```\n\n### Return\n\nA Rowset with the following columns: `datetime`, `log_type`, `log_level, `description`, `username`, `database`, `ip_address`, `connection_id`.\n\nA Rowset with the following columns:\n* **datetime**: log entry date and time\n* **log_type**: log type (a number from 1 to 8, see description)\n* **log_level**: log level (a number from 0 to 5, see description)\n* **description**: a textual description of the event\n* **username**: the username associated to the entry\n* **database**: the database name (if any) bound to the event\n* **ip_address**: the origin IP address\n* **connection_id**: the unique connection ID\n\n### Example\n\n```bash\n> LIST LOG LIMIT 10\n---------------------|----------|-----------|-------------------------------------------------|----------|----------|------------|---------------|\n datetime | log_type | log_level | description | username | database | ip_address | connection_id |\n---------------------|----------|-----------|-------------------------------------------------|----------|----------|------------|---------------|\n 2023-02-09 15:46:14 | 4 | 4 | LIST LOG LIMIT 10 | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 15:46:10 | 8 | 2 | 10002 Unable to find command LIST LOGS LIMIT 1 | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 15:46:04 | 8 | 2 | 10002 Unable to find command LIST LOGS LIMIT 10 | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 15:45:58 | 8 | 2 | 10002 Unable to find command LIST LOGS LIMIT 10 | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 15:34:40 | 4 | 4 | LIST USERS WITH ROLES | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 15:34:26 | 4 | 4 | LIST USERS | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 15:04:38 | 4 | 4 | LIST ALLOWED IP | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 14:56:15 | 4 | 4 | LIST ONLY RESERVED COMMANDS | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 14:56:05 | 4 | 4 | SET CLIENT KEY COMPRESSION TO 1; | admin | NULL | 127.0.0.1 | 1 |\n 2023-02-09 14:56:05 | 4 | 4 | AUTH USER admin PASSWORD ***** | NULL | NULL | 127.0.0.1 | 1 |\n---------------------|----------|-----------|-------------------------------------------------|----------|----------|------------|---------------|\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/log-commands.mdx","digest":"83aea8dba53e815e","deferredRender":true,"collection":"docs"}},{"title":"Plugins","filePath":"plugin-commands","type":"inner","level":1,"entry":{"id":"plugin-commands","data":{"title":"Plugin Commands","description":"Use these commands to manage the SQLite Cloud plugins.","customClass":"","category":"reference","status":"publish"},"body":"## DISABLE PLUGIN\n\nUse this command to disable a plugin. Established connections will continue to have that plugin loaded. The disabled setting affects only new connections.\n\n### Syntax\n\nDISABLE PLUGIN **plugin_name**\n\n### Privileges\n\n```\nPLUGIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> DISABLE PLUGIN sample.plugin\nOK\n```\n\n## ENABLE PLUGIN\n\nUse this command to re-enable a plugin previously disabled. Note that the newly enabled plugin is available only for new connections.\n\n### Syntax\n\nENABLE PLUGIN **plugin_name**\n\n### Privileges\n\n```\nPLUGIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> ENABLE PLUGIN sample.plugin\nOK\n```\n\n## LIST PLUGINS\n\nThe LIST PLUGINS command returns a rowset that provides information about the installed native/SQLite extensions.\n\n### Syntax\n\nLIST PLUGINS\n\n### Privileges\n\n```\nPLUGIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **name**: plugin name\n* **type**: plugin type (SQLite or SQLiteCloud)\n* **enabled**: 1 enabled, 0 disabled\n* **version**: plugin version\n* **copyright**: plugin copyright\n* **description**: plugin description\n\nThe **version**, **copyright** and **description** columns are not NULL only in case of native SQLite Cloud extensions developed with the official plugins SDK.\n\n### Example\n\n```bash\n> LIST PLUGINS\n---------|--------|---------|---------|-----------|-------------|\n name | type | enabled | version | copyright | description |\n---------|--------|---------|---------|-----------|-------------|\n crypto | SQLite | 1 | NULL | NULL | NULL |\n fileio | SQLite | 1 | NULL | NULL | NULL |\n fuzzy | SQLite | 1 | NULL | NULL | NULL |\n ipaddr | SQLite | 1 | NULL | NULL | NULL |\n math | SQLite | 1 | NULL | NULL | NULL |\n stats | SQLite | 1 | NULL | NULL | NULL |\n text | SQLite | 1 | NULL | NULL | NULL |\n unicode | SQLite | 1 | NULL | NULL | NULL |\n uuid | SQLite | 1 | NULL | NULL | NULL |\n vsv | SQLite | 1 | NULL | NULL | NULL |\n re | SQLite | 0 | NULL | NULL | NULL |\n---------|--------|---------|---------|-----------|-------------|\n\n```\n\n## LOAD PLUGIN\n\nIn a running server, the LOAD PLUGIN command forces plugin_name to be loaded in the core services. A loaded plugin is also enabled by default and will be registered in newly established connections.\n\n### Syntax\n\nLOAD PLUGIN **plugin_name**\n\n### Privileges\n\n```\nPLUGIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> LOAD PLUGIN sample.plugin\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/plugin-commands.mdx","digest":"683d0af344f5d395","deferredRender":true,"collection":"docs"}},{"title":"Privileges","filePath":"privilege-commands","type":"inner","level":1,"entry":{"id":"privilege-commands","data":{"title":"Privilege Commands","description":"Use these commands to manage privileges in SQLite Cloud.","customClass":"","category":"reference","status":"publish"},"body":"## GRANT PRIVILEGE\n\nUse this command to add a new **privilege_name** to an existing role. The **privilege_name** parameter can be a list of comma-separated privileges. You can further restrict this operation by specifying a **database_name** and/or a **table_name**.\n\n### Syntax\n\nGRANT PRIVILEGE **privilege_name** ROLE **role_name** [DATABASE **database_name**] [TABLE **table_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> GRANT PRIVILEGE readwrite ROLE role1\nOK\n```\n\n## LIST PRIVILEGES\n\nThe LIST PRIVILEGES command returns a rowset that contains a list of all the privileges built into SQLite Cloud.\n\n### Syntax\n\nLIST PRIVILEGES\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nA Rowset with one privilege **name** column.\n\n### Example\n\n```bash\n> LIST PRIVILEGES\n-----------------|\n name |\n-----------------|\n NONE |\n READ |\n INSERT |\n UPDATE |\n DELETE |\n READWRITE |\n PRAGMA |\n CREATE_TABLE |\n CREATE_INDEX |\n CREATE_VIEW |\n CREATE_TRIGGER |\n DROP_TABLE |\n DROP_INDEX |\n DROP_VIEW |\n DROP_TRIGGER |\n ALTER_TABLE |\n ANALYZE |\n ATTACH |\n DETACH |\n DBADMIN |\n SUB |\n PUB |\n PUBSUB |\n BACKUP |\n RESTORE |\n DOWNLOAD |\n PLUGIN |\n SETTINGS |\n USERADMIN |\n CLUSTERADMIN |\n CLUSTERMONITOR |\n CREATE_DATABASE |\n DROP_DATABASE |\n HOSTADMIN |\n ADMIN |\n PUBSUBCREATE |\n-----------------|\n```\n\n## SET PRIVILEGE\n\nThe SET PRIVILEGE command grants only specified privileges to a role. Previously granted privileges are revoked. The **privilege_name** parameter can be a list of comma-separated privileges.\n\n### Syntax\n\nSET PRIVILEGE **privilege_name** ROLE **role_name** [DATABASE **database_name**] [TABLE **table_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SET PRIVILEGE readwrite ROLE role1\nOK\n```\n\n## REVOKE PRIVILEGE\n\nUse this command to revoke a privilege (or a command-separated list of privileges) from the ROLE **role_name**. You can further restrict this command by specifying a database and/or a table name.\n\n### Syntax\n\nREVOKE PRIVILEGE **privilege_name** ROLE **role_name** [DATABASE **database_name**] [TABLE **table_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REVOKE PRIVILEGE privilege1 ROLE role1\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/privilege-commands.mdx","digest":"32eb2ddc5c45b0e6","deferredRender":true,"collection":"docs"}},{"title":"Pub/Sub","filePath":"pub-sub-commands","type":"inner","level":1,"entry":{"id":"pub-sub-commands","data":{"title":"Pub/Sub Commands","description":"Use these commands to manage the SQLite Cloud Pub/Sub feature.","customClass":"","category":"reference","status":"publish"},"body":"## CREATE CHANNEL\n\nThe CREATE CHANNEL command creates a new Pub/Sub environment channel.\nIt is usually an error to attempt to create a new channel if another one exists with the same name. However, if the \"IF NOT EXISTS\" clause is specified as part of the CREATE CHANNEL statement, and a channel of the same name already exists, the CREATE CHANNEL command has no effect (and no error message is returned). An error is still returned if the channel cannot be created for any other reason, even if the \"IF NOT EXISTS\" clause is specified.\n\n### Syntax\n\nCREATE CHANNEL **channel_name** [IF NOT EXISTS]\n\n### Privileges\n\n```\nPUBSUBCREATE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> CREATE CHANNEL channel1 IF NOT EXISTS\nOK\n```\n\n## LIST CHANNELS\n\nThe LIST CHANNELS command returns a list of previously created channels that can be used to exchange messages. This command returns only channels created with the CREATE CHANNEL command.\nYou can also subscribe to a table to receive all table-related events (INSERT, UPDATE, and DELETE). The LIST TABLES PUBSUB return a rowset compatible with the rowset returned by the LIST CHANNELS command.\n\n### Syntax\n\nLIST CHANNELS\n\n### Privileges\n\n```\nPUBSUB\n```\n\n### Return\n\nA Rowset with a single **chname** column that returns all channels created for Pub/Sub.\n\n### Example\n\n```bash\n> LIST CHANNELS\n----------|\n chname |\n----------|\n channel1 |\n channel2 |\n channel3 |\n channel4 |\n channel5 |\n channel6 |\n----------|\n```\n\n## LISTEN\n\nThe LISTEN command is used to start receiving notifications for a given channel/table.\nNothing is done if the current connection is registered as a listener for this notification channel.\nThe optional DATABASE parameter is ignored if the TABLE flag is not specified.\n\nThe optional TABLE flag specifies that you want to receive notification for a given table. The DATABASE parameter can be used to identify which database to use (or the current database will be used).\nLISTENING to a table means you'll receive notification about all the write operations in that table.\nIn the case of TABLE, the channel_name can be *, which means you'll start receiving notifications from all the tables inside the specified database.\n\n### Syntax\n\nLISTEN [TABLE] **channel_name** [DATABASE **database_name**]\n\n### Privileges\n\n```\nSUB\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> LISTEN channel1\nOK\n```\n## NOTIFY\n\nThe NOTIFY command sends an optional payload (usually a string) to a specified channel_name. If no payload is specified, then an empty notification is sent.\n\n### Syntax\n\nNOTIFY **channel_name** [**payload_value**]\n\n### Privileges\n\n```\nPUB\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> NOTIFY channel1 \"Hello World\"\nOK\n```\n\n## REMOVE CHANNEL\n\nThe REMOVE CHANNEL command completely deletes a previously created channel.\n\n### Syntax\n\nREMOVE CHANNEL **channel_name**\n\n### Privileges\n\n```\nPUBSUBCREATE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE CHANNEL channel1\nOK\n```\n\n## UNLISTEN\n\nThe UNLISTEN command is used to stop receiving notifications about a particular channel/table.\nIn the case of TABLE, the channel_name can be *, meaning you'll stop receiving notifications from all the tables inside the current database.\nThe DATABASE parameter can be used to identify which database to use (or the current database will be used).\nThe optional DATABASE parameter is ignored if the TABLE flag is not specified.\n\n### Syntax\n\nUNLISTEN [TABLE] **channel_name** [DATABASE **database_name**]\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> UNLISTEN channel1\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/pub-sub-commands.mdx","digest":"5dbdd61becd83693","deferredRender":true,"collection":"docs"}},{"title":"Query Analyzer","filePath":"query-analyzer-commands","type":"inner","level":1,"entry":{"id":"query-analyzer-commands","data":{"title":"Query Analyzer Commands","description":"These commands are used to analyze the performance of queries executed on the server.","customClass":"","category":"reference","status":"publish"},"body":"## ANALYZER PLAN ID\n\nThe ANALYZER PLAN ID command is used to gather information about the indexes used in the query plan of a query execution. Usually a SCAN tablename entry in the detail column, indicates that no indexes are found and a full table scan must be performed. The NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nANALYZER PLAN ID **query_id** [NODE **nodeid**]\n\n### Privileges\n\n```\nDBADMIN\n```\n\n### Return\n\nA Rowset with an analysis about the query id.\n\n### Example\n\n```bash\n> ANALYZER PLAN ID 57\n----|--------|---------|----------------|\n id | parent | notused | detail |\n----|--------|---------|----------------|\n 2 | 0 | 0 | SCAN customers |\n----|--------|---------|----------------|\n```\n\n## ANALYZER RESET\n\nThe ANALYZER RESET command resets the statistics about a specific query, a group of queries or a database. When the command is called with the ALL argument, it resets all the statistics.\nThe NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nANALYZER RESET [ID **query_id**] [GROUPID **query_id**] [DATABASE **database_name**] [ALL] [NODE **nodeid**]\n\n### Privileges\n\n```\nDBADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> ANALYZER RESET\nOK\n```\n\n## ANALYZER SUGGEST ID\n\nThe ANALYZER SUGGEST ID command analyzes a query_id and returns a suggestion about the optimal index to use to speed up that query.\nThe PERCENTAGE argument reduces the number of rows to analyze.\nThe APPLY argument writes the suggested index into the database automatically.\nThe NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nANALYZER SUGGEST ID **query_id** [PERCENTAGE **percentage**] [APPLY] [NODE **nodeid**]\n\n### Privileges\n\n```\nDBADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **statement**: reference to original statement (when multiple suggestions are returned)\n* **type**: 1 means SQL, 2 means INDEX, 3 means PLAN and 4 means CANDIDATE\n* **report**: sql or suggestion computed by the SQLite engine\n\n### Example\n\n```bash\n> ANALYZER SUGGEST ID 57\n----------|-------|----------------------------------------------------------------------------------------------------------------------------------------------|\nstatement | type | report |\n----------|-------|----------------------------------------------------------------------------------------------------------------------------------------------|\n0 | 1 | SELECT C.CUSTOMERID, SUM(I.TOTAL) FROM customers C JOIN invoices I ON C.CUSTOMERID = I.CUSTOMERID GROUP BY 1 ORDER BY 2 DESC; |\n0 | 2 | CREATE INDEX customers_idx_4f4310b6 ON customers(CustomerId DESC); |\n0 | 3 | SCAN C USING COVERING INDEX customers_idx_4f4310b6 SEARCH I USING INDEX IFK_InvoiceCustomerId (CustomerId=?) USE TEMP B-TREE FOR ORDER BY |\n0 | 4 | CREATE INDEX customers_idx_4f4310b6 ON customers(CustomerId DESC); -- stat1: 59 1 |\n----------|-------|----------------------------------------------------------------------------------------------------------------------------------------------|\n```\n\n## LIST ANALYZER\n\nThe LIST ANALYZER command returns a rowset with the slowest queries performed on the connected server.\nThe result of the LIST ANALYZER command can be further filtered using the GROUPID, DATABASE, and GROUPED options.\nThis command is usually performed with the GROUPED flag to group the slowest queries and reduce the output. The NODE argument forces the execution of the command to a specific node of the cluster.\n\n### Syntax\n\nLIST ANALYZER [GROUPID **group_id**] [DATABASE **database_name**] [GROUPED] [NODE **nodeid**]\n\n### Privileges\n\n```\nDBADMIN\n```\n\n### Return\n\nA Rowset with columns that depend on the command flags.\n\n### Example\n\n```bash\n> LIST ANALYZER GROUPED\n----------|--------------------------------------|--------------------|-------------------|-----------------|-------------------|\n group_id | sql | database | AVG(query_time) | MAX(query_time) | COUNT(query_time) |\n----------|--------------------------------------|--------------------|-------------------|-----------------|-------------------|\n 57 | SELECT*FROM customers; | chinook-enc.sqlite | 2.02896333333333 | 2.462731 | 3 |\n 54 | SELECT*FROM customers; | chinook.sqlite | 1.907214 | 1.907214 | 1 |\n 62 | SELECT*FROM t1 WHERE _rowid_=?; | db1.sqlite | 1.238739 | 1.238739 | 1 |\n 82 | SELECT*FROM albums; | chinook.sqlite | 0.924273967741935 | 2.081847 | 31 |\n 52 | SELECT*FROM artists; | chinook.sqlite | 0.820239 | 0.944221 | 2 |\n 77 | SELECT*FROM t1; | db1.sqlite | 0.6965005 | 0.706278 | 2 |\n 34 | SELECT*FROM artists WHERE _rowid_=?; | chinook.sqlite | 0.659359 | 0.659359 | 1 |\n 66 | SELECT*FROM playlists; | chinook.sqlite | 0.634047666666667 | 0.720039 | 3 |\n----------|--------------------------------------|--------------------|-------------------|-----------------|-------------------|\n\n> LIST ANALYZER GROUPID 57\n----|------------------------|--------------------|------------|---------------------|\n id | sql | database | query_time | datetime |\n----|------------------------|--------------------|------------|---------------------|\n 57 | SELECT*FROM customers; | chinook-enc.sqlite | 1.633654 | 2022-12-27 20:42:04 |\n 56 | SELECT*FROM customers; | chinook-enc.sqlite | 1.990505 | 2022-12-27 20:42:03 |\n 55 | SELECT*FROM customers; | chinook-enc.sqlite | 2.462731 | 2022-12-27 20:41:43 |\n----|------------------------|--------------------|------------|---------------------|\n \n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/query-analyzer-commands.mdx","digest":"7f21ea465b05f4a3","deferredRender":true,"collection":"docs"}},{"title":"Roles","filePath":"role-commands","type":"inner","level":1,"entry":{"id":"role-commands","data":{"title":"Role Commands","description":"Role commands allow you to manage roles in SQLite Cloud.","customClass":"","category":"reference","status":"publish"},"body":"## CREATE ROLE\n\nRoles grant users access to SQLite Cloud resources (a database, a table, or global). SQLite Cloud provides several built-in roles administrators can use to control access to an SQLite Cloud system. However, if these roles cannot describe the desired set of privileges, you can create new roles in a particular database/table.\nThe optional PRIVILEGE parameter specifies which privileges (in comma-separated format) must be associated with the ROLE. A privilege can later be associated with a ROLE using the GRANT PRIVILEGE command.\nThe DATABASE and TABLE optional arguments can restrict the particular PRIVILEGES to a specific resource (otherwise, the ROLE is considered global). If PRIVILEGES is omitted then DATABASE and TABLE parameters are ignored.\n\n### Syntax\n\nCREATE ROLE **role_name** [PRIVILEGE **privilege_name** [DATABASE **database_name**] [TABLE **table_name**]]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> CREATE ROLE sample_role PRIVILEGE CLUSTERADMIN,CLUSTERMONITOR,READWRITE\nOK\n```\n\n## GRANT ROLE\n\nUse this command to add a new **role_name** to an existing username. You can further restrict this operation by specifying a **database_name** and/or a **table_name**.\n\n### Syntax\n\nGRANT ROLE **role_name** USER **username** [DATABASE **database_name**] [TABLE **table_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> GRANT ROLE role1 USER user1\nOK\n```\n\n## LIST ROLES\n\nThe LIST ROLES command returns a rowset containing all the ROLES (built-in and user-defined) configured into SQLite Cloud. A ROLE can be associated with a specific database or table or globally defined (in that case, the databasename and/or tablename columns are set to `*`).\n\n### Syntax\n\nLIST ROLES\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **rolename**: the name of the role\n* **builtin**: 1 if it is a built-in role, 0 otherwise\n* **privileges**: a comma separated list of privileges associated to the role\n* **databasename**: an optional database name to further restrict the role\n* **tablename**: an optional table name to further restrict the role\n\n### Example\n\n```bash\n> LIST ROLES\n-----------------------|---------|-----------------------------|--------------|-----------|\n rolename | builtin | privileges | databasename | tablename |\n-----------------------|---------|-----------------------------|--------------|-----------|\n ADMIN | 1 | READ,INSERT,UPDATE,... | NULL | NULL |\n READ | 1 | READ | NULL | NULL |\n READANYDATABASE | 1 | READ | * | * |\n READWRITE | 1 | READ,INSERT,UPDATE,... | NULL | NULL |\n READWRITEANYDATABASE | 1 | READ,INSERT,UPDATE,... | * | * |\n DBADMIN | 1 | READ,INSERT,UPDATE,... | NULL | NULL |\n DBADMINANYDATABASE | 1 | READ,INSERT,UPDATE,... | * | * |\n USERADMIN | 1 | USERADMIN | NULL | NULL |\n CLUSTERADMIN | 1 | CLUSTERADMIN | NULL | NULL |\n CLUSTERMONITOR | 1 | CLUSTERMONITOR | NULL | NULL |\n HOSTADMIN | 1 | BACKUP,RESTORE,... | NULL | NULL |\n SUB | 1 | SUB | NULL | NULL |\n SUBANYCHANNEL | 1 | SUB | * | * |\n PUB | 1 | PUB | NULL | NULL |\n PUBANYCHANNEL | 1 | PUB | * | * |\n PUBSUB | 1 | SUB,PUB,PUBSUB | NULL | NULL |\n PUBSUBANYCHANNEL | 1 | SUB,PUB,PUBSUB | * | * |\n PUBSUBADMIN | 1 | SUB,PUB,PUBSUB,PUBSUBCREATE | NULL | NULL |\n PUBSUBADMINANYCHANNEL | 1 | SUB,PUB,PUBSUB,PUBSUBCREATE | * | * |\n-----------------------|---------|-----------------------------|--------------|-----------|\n```\n\n## REMOVE ROLE\n\nThe REMOVE ROLE command permanently deletes the **role_name** from the server. The role is also removed from users, privileges, and IP restrictions tables as a side effect.\n\n### Syntax\n\nREMOVE ROLE **role_name**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE ROLE role1\nOK\n```\n\n## RENAME ROLE\n\nThe RENAME ROLE command renames an existing role to a new name.\n\n### Syntax\n\nRENAME ROLE **role_name** TO **new_role_name**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> RENAME ROLE old_role TO new_role\nOK\n```\n\n## REVOKE ROLE\n\nUse this command to revoke a role from the USER **username**. You can further restrict this command by specifying a database and/or a table name.\n\n### Syntax\n\nREVOKE ROLE **role_name** USER **username** [DATABASE **database_name**] [TABLE **table_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REVOKE ROLE role1 USER user1\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/role-commands.mdx","digest":"a72eb6136bba6610","deferredRender":true,"collection":"docs"}},{"title":"Settings","filePath":"settings-commands","type":"inner","level":1,"entry":{"id":"settings-commands","data":{"title":"Settings Commands","description":"Settings commands are used to manage settings in SQLite Cloud.","customClass":"","category":"reference","status":"publish"},"body":"## GET CLIENT KEY\n\nThe GET CLIENT KEY command retrieves a single specific information about a **keyname**.\n\n### Syntax\n\nGET CLIENT KEY **keyname**\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nA single value (usually a String) that depends on the input **keyname**.\n\n### Example\n\n```bash\n> GET CLIENT KEY IP\n127.0.0.1\n\n> GET CLIENT KEY COMPRESSION\n1\n```\n\n## GET DATABASE KEY\n\nUse this command to retrieve a single value associated with **database_name** and **keyname**.\n\n### Syntax\n\nGET DATABASE **database_name** KEY **keyname**\n\n### Privileges\n\n```\nPRAGMA\n```\n\n### Return\n\nA String with the requested value.\n\n### Example\n\n```bash\n> GET DATABASE mediastore.sqlite KEY key1\nvalue1\n```\n\n## GET KEY\n\nThe GET KEY command retrieves a single specific setting about a **keyname**.\n\n### Syntax\n\nGET KEY **keyname**\n\n### Privileges\n\n```\nSETTINGS\n```\n\n### Return\n\nA single value (usually a String) that depends on the input **keyname**.\n\n### Example\n\n```bash\n> GET KEY max_chunk_size\n307200\n\n> GET KEY non_existing_key\nNULL\n```\n\n## LIST CLIENT KEYS\n\nThe LIST CLIENT KEYS command retrieves information and settings specific to the current connection. Use the GET CLIENT KEY **key** command to retrieve specific information.\n\n### Syntax\n\nLIST CLIENT KEYS\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nA Rowset with the following columns:\n* **key**: client key\n* **value**: client value\n\n### Example\n\n```bash\n> LIST CLIENT KEYS\n-----------------|--------------------------------------|\n key | value |\n-----------------|--------------------------------------|\n COMPRESSION | 1 |\n ID | 1 |\n IP | 127.0.0.1 |\n MAXDATA | 0 |\n MAXROWS | 0 |\n MAXROWSET | 0 |\n NOBLOB | 0 |\n NONLINEARIZABLE | 0 |\n SQLITE | 0 |\n UUID | 374c7c93-c8bb-4ba8-ac19-26edb78fc1cc |\n ZEROTEXT | 0 |\n-----------------|--------------------------------------|\n```\n\n## LIST KEYS\n\nThe LIST KEYS command retrieves the server settings.\nSome of the returned settings are read-only and cannot be set. To retrieve more information about the settings, use the DETAILED flag.\nAll the KEYS in the settings database are automatically distributed all over the cluster.\nTo retrieve a single specific information, use the GET KEY **key** command.\n\n### Syntax\n\nLIST KEYS [DETAILED] [NOREADONLY]\n\n### Privileges\n\n```\nSETTINGS\n```\n\n### Return\n\nA Rowset with the following columns:\n* **key**: settings key\n* **value**: settings value\n* **default_value**: default value\n* **readonly**: 1 if key is read-only\n* **description**: key description\n\nThe additional **default_value**, **readonly** and **description** columns are returned only if the DETAILED flag is used.\n\n### Example\n\n```bash\n> LIST KEYS\n---------------------------------|-------------------------------|\n key | value |\n---------------------------------|-------------------------------|\n autocheckpoint | 1000 |\n autocheckpoint_full | 0 |\n backlog | 512 |\n backup_node_id | 0 |\n base_path | /Users/marco/SQLiteCloud/data |\n client_compression | 1 |\n client_timeout | 0 |\n cluster_address | NULL |\n---------------------------------|-------------------------------|\n\n> LIST KEYS DETAILED\n---------------------------------|-------------------------------|---------------|----------|--------------------------------------------------------------------------|\n key | value | default_value | readonly | description |\n---------------------------------|-------------------------------|---------------|----------|--------------------------------------------------------------------------|\n autocheckpoint | 1000 | 1000 | 0 | Number of frames in the WAL file above which a checkpoint is run. |\n autocheckpoint_full | 0 | 0 | 0 | Number of frames in the WAL file above which a full checkpoint is run. |\n backlog | 512 | 512 | 0 | Size of the backlog queue for the socket listening function. |\n base_path | /Users/marco/SQLiteCloud/data | NULL | 1 | Full path to the main data directory. |\n client_compression | 1 | 0 | 0 | Custom key set by the user. |\n client_timeout | 0 | 0 | 0 | Maximum time (in seconds) to allow a connected client to stay connected. |\n --------------------------------|-------------------------------|---------------|----------|--------------------------------------------------------------------------|\n \n```\n\n## REMOVE CLIENT KEY\n\nThe REMOVE CLIENT KEY command is used to reset to a default value a **keyname**\n\n### Syntax\n\nREMOVE CLIENT KEY **keyname**\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE CLIENT KEY COMPRESSION\nOK\n```\n\n## REMOVE DATABASE KEY\n\nUse this command to permanently remove **keyname** from the list of settings for the database **database_name**.\n\n### Syntax\n\nREMOVE DATABASE **database_name** KEY **keyname**\n\n### Privileges\n\n```\nPRAGMA\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE DATABASE mediastore.sqlite KEY key1\nOK\n```\n\n## REMOVE KEY\n\nThe REMOVE KEY command permanently deletes a **keyname** from the settings database file (the change is automatically distributed on the cluster). Removing a previously set **keyname** value usually means restoring its default value.\n\n### Syntax\n\nREMOVE KEY **keyname**\n\n### Privileges\n\n```\nSETTINGS\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE KEY max_chunk_size\nOK\n```\n\n## SET CLIENT KEY\n\nThe SET CLIENT KEY command sets a **keyname** to a specific **keyvalue**.\n\n### Syntax\n\nSET CLIENT KEY **keyname** TO **keyvalue**\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SET CLIENT KEY COMPRESSION TO 0\nOK\n```\n\n## SET DATABASE KEY\n\nUse this command to set a specific key/value setting to **database_name**.\n\nYou can use any key/value, but some keys are reserved for a special purpose:\n* use_concurrent_transactions: set to 1 or 0 to enable/disable CONCURRENT transaction for the database\n* DATABASE_KEY: set to the encryption key used to decrypt the database file. Note that this is not equivalent to encrypting a database. This value must be used to set an encryption key for an already encrypted database.\n\n### Syntax\n\nSET DATABASE **database_name** KEY **keyname** TO **keyvalue**\n\n### Privileges\n\n```\nPRAGMA\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SET DATABASE mediastore.sqlite KEY key1 VALUE value1\nOK\n```\n\n## SET KEY\n\nThe SET KEY command sets or updates a **keyname** to a specific **keyvalue**. Once set, the server immediately uses the updated value (and automatically distributes it on the cluster).\n\n### Syntax\n\nSET KEY **keyname** TO **keyvalue**\n\n### Privileges\n\n```\nSETTINGS\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SET KEY max_chunk_size TO 524288\nOK\n```\n\n## LIST ENV\n\nThe LIST ENV command lists all the environment variables for the project.\n\n### Syntax\n```\nLIST ENV\n```\n\n### Description\n\n## GET ENV\n\nThe GET ENV command retrieves the value of a specific environment variable.\n\n### Syntax\n```\nGET ENV key\n```\n\n## SET ENV\n\nThe SET ENV command sets the value of an environment variable.\n\n### Syntax\n```\nSET ENV key VALUE value\n```\n### Description\n\n## REMOVE ENV\n\nThe REMOVE ENV command removes the given environment variable.\n\n### Syntax\n```\nREMOVE ENV key\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/settings-commands.mdx","digest":"539958f1dd2ee6a5","deferredRender":true,"collection":"docs"}},{"title":"User","filePath":"user-commands","type":"inner","level":1,"entry":{"id":"user-commands","data":{"title":"User Commands","description":"Use these commands to manage the SQLite Cloud users.","customClass":"","category":"reference","status":"publish"},"body":"## CREATE USER\n\nThe CREATE USER command adds a new user **username** with a specified **password** to the server. During user creation, you can also pass a comma-separated list of roles to apply to that user. The DATABASE and TABLE optional arguments can restrict the particular ROLE to a specific resource. If ROLE is omitted then DATABASE and TABLE parameters are ignored.\n\n### Syntax\n\nCREATE USER **username** PASSWORD **password** [ROLE **role_name** [DATABASE **database_name**] [TABLE **table_name**]]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> CREATE USER user1 PASSWORD gdfhjs76fdgshj\nOK\n```\n\n## DISABLE USER\n\nThe DISABLE USER command disables a specified username from the system (it does not remove it).\nAfter command execution, the user specified in the **username** argument can no longer log into the system.\n\n### Syntax\n\nDISABLE USER **username**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> DISABLE USER user1\nOK\n```\n\n## ENABLE USER\n\nThe ENABLE USER command re-enables a previously disabled user from the system. Once re-enabled, that username can log in again.\n\n### Syntax\n\nENABLE USER **username**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> ENABLE USER user1\nOK\n```\n\n## GET USER\n\nThe GET USER command returns the username of the currency-connected user.\n\n### Syntax\n\nGET USER\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nA String set to the current username.\n\n### Example\n\n```bash\n> GET USER\nadmin\n```\n\n## LIST USERS\n\nThe LIST USERS command retrieves a list of all users created on the server. The WITH ROLES argument also adds a column with a list of roles associated with each username. To restrict the list to all the users that get access to a specific database and/or table you can use the DATABASE and/or TABLE arguments.\n\n### Syntax\n\nLIST USERS [WITH ROLES] [DATABASE **database_name**] [TABLE **table_name**]\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nA Rowset with the following columns:\n* **username**: user name\n* **enabled**: 1 enabled, 0 disabled\n* **roles**: list of roles\n* **databasename**: database name\n* **tablename**: table name\n\nThe ** roles**, ** databasename** and ** tablename** columns are returned only when the WITH ROLES flag is used.\n\n### Example\n\n```bash\n> LIST USERS\n----------|---------|\n username | enabled |\n----------|---------|\n admin | 1 |\n----------|---------|\n\n> LIST USERS WITH ROLES\n----------|---------|-------|--------------|-----------|\n username | enabled | roles | databasename | tablename |\n----------|---------|-------|--------------|-----------|\n admin | 1 | ADMIN | * | * |\n----------|---------|-------|--------------|-----------|\n```\n\n## REMOVE USER\n\nThe REMOVE USER command removes the user specified in the **username** parameter from the system. After command execution, the **username** cannot log in to the server. Admin users cannot be removed from the system.\n\n### Syntax\n\nREMOVE USER **username**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> REMOVE USER user1\nOK\n```\n\n## RENAME USER\n\nThe RENAME USER command updates an existing username to a new one.\n\n### Syntax\n\nRENAME USER **username** TO **new_username**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> RENAME USER user1 TO user2\nOK\n```\n\n## SET MY PASSWORD\n\nThe SET MY PASSWORD command changes the password for the currently connected user.\n\n### Syntax\n\nSET MY PASSWORD **password**\n\n### Privileges\n\n```\nNONE\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SET MY PASSWORD foo\nOK\n```\n\n## SET PASSWORD\n\nThe SET PASSWORD command sets or changes the password for an existing username.\n\n### Syntax\n\nSET PASSWORD **password** USER **username**\n\n### Privileges\n\n```\nUSERADMIN\n```\n\n### Return\n\nOK string or error value (see SCSP protocol).\n\n### Example\n\n```bash\n> SET PASSWORD uweri76878dsa USER user1\nOK\n```","filePath":"docs-website/content/docs/sqlite-cloud/reference/user-commands.mdx","digest":"dc2b58664e2fe683","deferredRender":true,"collection":"docs"}},{"title":"Introduction","filePath":"cli-commands","type":"inner","level":1,"entry":{"id":"cli-commands","data":{"title":"Command Line Interface","description":"The SQLite Cloud Command Line Interface is a user-friendly interface that runs on the terminal and acts as a front-end to SQLite Cloud.","customClass":"","category":"reference","status":"publish"},"body":"The **SQLite Cloud Command Line Interface** is a user-friendly interface that runs on the terminal and acts as a front-end to SQLite Cloud. This interface allows you to enter queries interactively, submit them to SQLite Cloud, and view the resulting data. Additionally, input can come from a file or command line arguments, giving you greater flexibility in how you interact with SQLite Cloud.\n\nIt's worth noting that there are two versions of the CLI available: one written in C and one written in GO. Both versions offer the same functionality, and the source code is provided for both. The C version was the first to be developed and was extensively used during the development of SQLite Cloud. It's based on the C SDK. The GO version, on the other hand, was created later, after the GO SDK was released. In the future, we plan to combine both projects into a unified CLI.\n\n* Binaries can be downloaded from GitHub.\n* C source code can be downloaded from the C SDK repo.\n* GO source code can be downlaoded from the GO SDK repo.\n\nThe C cli (sqlitecloud-cli) is available for Linux (x86) and macOS (Intel and ARM).\n\nThe GO cli (sqlc) is available for Linux (x86), Windows (x86) and macOS (Intel and ARM).","filePath":"docs-website/content/docs/sqlite-cloud/reference/cli-commands.mdx","digest":"a147967f2e6d355d","deferredRender":true,"collection":"docs"}}]">

    Getting Started with SQLite Cloud

    Overview

    SQLite Cloud is a managed, distributed relational database system built on top of the SQLite database engine.

    It has been designed from the ground up to ensure strong consistency across all nodes in a cluster while simultaneously managing the technical aspects of scaling, security, and data distribution. This ensures that you can focus on your core tasks while relying on SQLite Cloud to handle the complexities of managing your databases.

    SQLite Cloud is built on the open source SQLite engine, ensuring complete feature parity. You get all of SQLite’s core strengths: ACID compliance, support for complex SQL operations, and compatibility with the rich SQLite extension ecosystem.

    You can access SQLite Cloud from the most popular programming languages or its REST API.

    Like SQLite, each database in SQLite Cloud is a separate file, giving you flexible deployment options:

    • Create separate databases for each customer in a multi-tenant application
    • Share a single database among multiple users with built-in access controls
    • Mix both approaches based on your application’s needs

    Features

    SQLite Cloud provides a comprehensive suite of tools for building realtime, local-first, edge AI applications.

    • Webhooks: Trigger edge functions or send change payloads via HTTP, Websockets, or on database events like INSERT, UPDATE, and DELETE.
    • Edge Functions: Run serverless functions on the same nodes that store your data for lightning-fast data access.
    • Pub/Sub: Subscribe to changes in your database to replicate data, power notifications, and build multiplayer experiences.
    • Weblite: Autogenerated REST APIs to interact with the SQLite Cloud platform.
    • Query Analyzer: Receive optimization recommendations for your queries to improve performance.