github/copilot-sdk · error

SQLite is not supported by this provider

Error message

SQLite is not supported by this provider

What it means

Thrown by the SQLite query handler in createSessionFsAdapter when a sqliteQuery request arrives but the session filesystem provider does not implement the optional `sqlite` capability. The adapter deliberately lets this plain Error propagate so the original message appears in the JSON-RPC error response instead of being remapped to a SessionFsError.

Solutions

  1. Implement the `sqlite` capability on your provider (query method) or switch to a provider that supports it
  2. Gate sqliteQuery calls behind a capability check (provider.sqlite presence / advertised features)
  3. Disable or avoid the SQL-backed feature when using a filesystem-only provider

Example fix

// before
const res = await sessionFs.sqliteQuery({ queryType: "all", query: "SELECT 1" }); // provider has no sqlite
// after
if (provider.sqlite) {
  const res = await sessionFs.sqliteQuery({ queryType: "all", query: "SELECT 1" });
} else {
  // fallback to file-based API or surface unsupported feature
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (!provider.sqlite) throw new Error("This feature requires a sqlite-capable sessionFs provider");

Type guard

function hasSqlite(p) {
  return typeof p?.sqlite?.query === "function";
}

Try / catch

try {
  return await sessionFs.sqliteQuery({ queryType, query, params });
} catch (err) {
  if (err?.message === "SQLite is not supported by this provider") {
    return fileBasedFallback(query);
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling the session-fs sqliteQuery JSON-RPC method against a provider constructed without a `sqlite` property; a custom provider that only implements file operations; provider built by an older factory version predating sqlite support.

Common situations: Custom sessionFs provider implementations missing the sqlite interface; running SQL-backed features (journaling, search) against a plain filesystem provider; feature flags enabling sqlite-dependent features on providers that cannot serve them.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/89875995fc470a5b. Report an issue: GitHub.

Appendix: source

Thrown at nodejs/src/sessionFsProvider.ts:261

                return toSessionFsError(err);
            }
        },
        rename: async ({ src, dest }) => {
            try {
                await provider.rename(src, dest);
                return undefined;
            } catch (err) {
                return toSessionFsError(err);
            }
        },
        // Unlike the FS methods above, SQLite methods let errors propagate to the JSON-RPC layer
        // rather than catching and mapping via toSessionFsError. The FS error mapping is specifically
        // for translating Node.js errno codes (e.g., ENOENT) into SessionFsError, which isn't
        // meaningful for SQL errors. Letting exceptions propagate preserves the original error
        // message in the JSON-RPC error response.
        sqliteQuery: async ({ queryType, query, params: bindParams }) => {
            if (!provider.sqlite) {
                throw new Error("SQLite is not supported by this provider");
            }
            const result = await provider.sqlite.query(
                queryType,
                query,
                normalizeSqliteParams(bindParams)
            );
            return result ?? { rows: [], columns: [], rowsAffected: 0 };
        },
        sqliteTransaction: async ({ statements }) => {
            if (!provider.sqlite?.transaction) {
                return {
                    results: [],
                    error: {
                        errorClass: "fatal",
                        message: "SQLite transactions are not supported by this provider",
                    },
                };
            }

View on GitHub (pinned to cd8cf15dc3)