1 line
32 KiB
JSON
1 line
32 KiB
JSON
{"ast":null,"code":"\"use strict\";\n\nconst {\n load,\n currentTarget\n} = require(\"@neon-rs/load\");\nconst {\n familySync,\n GLIBC\n} = require(\"detect-libc\");\nfunction requireNative() {\n if (process.env.LIBSQL_JS_DEV) {\n return load(__dirname);\n }\n let target = currentTarget();\n // Workaround for Bun, which reports a musl target, but really wants glibc...\n if (familySync() == GLIBC) {\n switch (target) {\n case \"linux-x64-musl\":\n target = \"linux-x64-gnu\";\n break;\n case \"linux-arm64-musl\":\n target = \"linux-arm64-gnu\";\n break;\n }\n }\n return require(`@libsql/${target}`);\n}\nconst {\n databaseOpen,\n databaseOpenWithRpcSync,\n databaseInTransaction,\n databaseClose,\n databaseSyncSync,\n databaseSyncUntilSync,\n databaseExecSync,\n databasePrepareSync,\n databaseDefaultSafeIntegers,\n databaseLoadExtension,\n databaseMaxWriteReplicationIndex,\n statementRaw,\n statementIsReader,\n statementGet,\n statementRun,\n statementRowsSync,\n statementColumns,\n statementSafeIntegers,\n rowsNext\n} = requireNative();\nconst SqliteError = require(\"./sqlite-error\");\nfunction convertError(err) {\n if (err.libsqlError) {\n return new SqliteError(err.message, err.code, err.rawCode);\n }\n return err;\n}\n\n/**\n * Database represents a connection that can prepare and execute SQL statements.\n */\nclass Database {\n /**\n * Creates a new database connection. If the database file pointed to by `path` does not exists, it will be created.\n *\n * @constructor\n * @param {string} path - Path to the database file.\n */\n constructor(path, opts) {\n const encryptionCipher = opts?.encryptionCipher ?? \"aes256cbc\";\n if (opts && opts.syncUrl) {\n var authToken = \"\";\n if (opts.syncAuth) {\n console.warn(\"Warning: The `syncAuth` option is deprecated, please use `authToken` option instead.\");\n authToken = opts.syncAuth;\n } else if (opts.authToken) {\n authToken = opts.authToken;\n }\n const encryptionKey = opts?.encryptionKey ?? \"\";\n const syncPeriod = opts?.syncPeriod ?? 0.0;\n const readYourWrites = opts?.readYourWrites ?? true;\n this.db = databaseOpenWithRpcSync(path, opts.syncUrl, authToken, encryptionCipher, encryptionKey, syncPeriod, readYourWrites);\n } else {\n const authToken = opts?.authToken ?? \"\";\n const encryptionKey = opts?.encryptionKey ?? \"\";\n this.db = databaseOpen(path, authToken, encryptionCipher, encryptionKey);\n }\n // TODO: Use a libSQL API for this?\n this.memory = path === \":memory:\";\n this.readonly = false;\n this.name = \"\";\n this.open = true;\n const db = this.db;\n Object.defineProperties(this, {\n inTransaction: {\n get() {\n return databaseInTransaction(db);\n }\n }\n });\n }\n sync() {\n return databaseSyncSync.call(this.db);\n }\n syncUntil(replicationIndex) {\n return databaseSyncUntilSync.call(this.db, replicationIndex);\n }\n\n /**\n * Prepares a SQL statement for execution.\n *\n * @param {string} sql - The SQL statement string to prepare.\n */\n prepare(sql) {\n try {\n const stmt = databasePrepareSync.call(this.db, sql);\n return new Statement(stmt);\n } catch (err) {\n throw convertError(err);\n }\n }\n\n /**\n * Returns a function that executes the given function in a transaction.\n *\n * @param {function} fn - The function to wrap in a transaction.\n */\n transaction(fn) {\n if (typeof fn !== \"function\") throw new TypeError(\"Expected first argument to be a function\");\n const db = this;\n const wrapTxn = mode => {\n return (...bindParameters) => {\n db.exec(\"BEGIN \" + mode);\n try {\n const result = fn(...bindParameters);\n db.exec(\"COMMIT\");\n return result;\n } catch (err) {\n db.exec(\"ROLLBACK\");\n throw err;\n }\n };\n };\n const properties = {\n default: {\n value: wrapTxn(\"\")\n },\n deferred: {\n value: wrapTxn(\"DEFERRED\")\n },\n immediate: {\n value: wrapTxn(\"IMMEDIATE\")\n },\n exclusive: {\n value: wrapTxn(\"EXCLUSIVE\")\n },\n database: {\n value: this,\n enumerable: true\n }\n };\n Object.defineProperties(properties.default.value, properties);\n Object.defineProperties(properties.deferred.value, properties);\n Object.defineProperties(properties.immediate.value, properties);\n Object.defineProperties(properties.exclusive.value, properties);\n return properties.default.value;\n }\n pragma(source, options) {\n if (options == null) options = {};\n if (typeof source !== 'string') throw new TypeError('Expected first argument to be a string');\n if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');\n const simple = options['simple'];\n const stmt = this.prepare(`PRAGMA ${source}`, this, true);\n return simple ? stmt.pluck().get() : stmt.all();\n }\n backup(filename, options) {\n throw new Error(\"not implemented\");\n }\n serialize(options) {\n throw new Error(\"not implemented\");\n }\n function(name, options, fn) {\n // Apply defaults\n if (options == null) options = {};\n if (typeof options === \"function\") {\n fn = options;\n options = {};\n }\n\n // Validate arguments\n if (typeof name !== \"string\") throw new TypeError(\"Expected first argument to be a string\");\n if (typeof fn !== \"function\") throw new TypeError(\"Expected last argument to be a function\");\n if (typeof options !== \"object\") throw new TypeError(\"Expected second argument to be an options object\");\n if (!name) throw new TypeError(\"User-defined function name cannot be an empty string\");\n throw new Error(\"not implemented\");\n }\n aggregate(name, options) {\n // Validate arguments\n if (typeof name !== \"string\") throw new TypeError(\"Expected first argument to be a string\");\n if (typeof options !== \"object\" || options === null) throw new TypeError(\"Expected second argument to be an options object\");\n if (!name) throw new TypeError(\"User-defined function name cannot be an empty string\");\n throw new Error(\"not implemented\");\n }\n table(name, factory) {\n // Validate arguments\n if (typeof name !== \"string\") throw new TypeError(\"Expected first argument to be a string\");\n if (!name) throw new TypeError(\"Virtual table module name cannot be an empty string\");\n throw new Error(\"not implemented\");\n }\n loadExtension(...args) {\n databaseLoadExtension.call(this.db, ...args);\n }\n maxWriteReplicationIndex() {\n return databaseMaxWriteReplicationIndex.call(this.db);\n }\n\n /**\n * Executes a SQL statement.\n *\n * @param {string} sql - The SQL statement string to execute.\n */\n exec(sql) {\n try {\n databaseExecSync.call(this.db, sql);\n } catch (err) {\n throw convertError(err);\n }\n }\n\n /**\n * Closes the database connection.\n */\n close() {\n databaseClose.call(this.db);\n this.open = false;\n }\n\n /**\n * Toggle 64-bit integer support.\n */\n defaultSafeIntegers(toggle) {\n databaseDefaultSafeIntegers.call(this.db, toggle ?? true);\n return this;\n }\n unsafeMode(...args) {\n throw new Error(\"not implemented\");\n }\n}\n\n/**\n * Statement represents a prepared SQL statement that can be executed.\n */\nclass Statement {\n constructor(stmt) {\n this.stmt = stmt;\n }\n\n /**\n * Toggle raw mode.\n *\n * @param raw Enable or disable raw mode. If you don't pass the parameter, raw mode is enabled.\n */\n raw(raw) {\n statementRaw.call(this.stmt, raw ?? true);\n return this;\n }\n get reader() {\n return statementIsReader.call(this.stmt);\n }\n\n /**\n * Executes the SQL statement and returns an info object.\n */\n run(...bindParameters) {\n try {\n if (bindParameters.length == 1 && typeof bindParameters[0] === \"object\") {\n return statementRun.call(this.stmt, bindParameters[0]);\n } else {\n return statementRun.call(this.stmt, bindParameters.flat());\n }\n } catch (err) {\n throw convertError(err);\n }\n }\n\n /**\n * Executes the SQL statement and returns the first row.\n *\n * @param bindParameters - The bind parameters for executing the statement.\n */\n get(...bindParameters) {\n if (bindParameters.length == 1 && typeof bindParameters[0] === \"object\") {\n return statementGet.call(this.stmt, bindParameters[0]);\n } else {\n return statementGet.call(this.stmt, bindParameters.flat());\n }\n }\n\n /**\n * Executes the SQL statement and returns an iterator to the resulting rows.\n *\n * @param bindParameters - The bind parameters for executing the statement.\n */\n iterate(...bindParameters) {\n var rows = undefined;\n if (bindParameters.length == 1 && typeof bindParameters[0] === \"object\") {\n rows = statementRowsSync.call(this.stmt, bindParameters[0]);\n } else {\n rows = statementRowsSync.call(this.stmt, bindParameters.flat());\n }\n const iter = {\n nextRows: Array(100),\n nextRowIndex: 100,\n next() {\n if (this.nextRowIndex === 100) {\n rowsNext.call(rows, this.nextRows);\n this.nextRowIndex = 0;\n }\n const row = this.nextRows[this.nextRowIndex];\n this.nextRows[this.nextRowIndex] = undefined;\n if (!row) {\n return {\n done: true\n };\n }\n this.nextRowIndex++;\n return {\n value: row,\n done: false\n };\n },\n [Symbol.iterator]() {\n return this;\n }\n };\n return iter;\n }\n\n /**\n * Executes the SQL statement and returns an array of the resulting rows.\n *\n * @param bindParameters - The bind parameters for executing the statement.\n */\n all(...bindParameters) {\n const result = [];\n for (const row of this.iterate(...bindParameters)) {\n result.push(row);\n }\n return result;\n }\n\n /**\n * Returns the columns in the result set returned by this prepared statement.\n */\n columns() {\n return statementColumns.call(this.stmt);\n }\n\n /**\n * Toggle 64-bit integer support.\n */\n safeIntegers(toggle) {\n statementSafeIntegers.call(this.stmt, toggle ?? true);\n return this;\n }\n}\nmodule.exports = Database;\nmodule.exports.SqliteError = SqliteError;","map":{"version":3,"names":["load","currentTarget","require","familySync","GLIBC","requireNative","process","env","LIBSQL_JS_DEV","__dirname","target","databaseOpen","databaseOpenWithRpcSync","databaseInTransaction","databaseClose","databaseSyncSync","databaseSyncUntilSync","databaseExecSync","databasePrepareSync","databaseDefaultSafeIntegers","databaseLoadExtension","databaseMaxWriteReplicationIndex","statementRaw","statementIsReader","statementGet","statementRun","statementRowsSync","statementColumns","statementSafeIntegers","rowsNext","SqliteError","convertError","err","libsqlError","message","code","rawCode","Database","constructor","path","opts","encryptionCipher","syncUrl","authToken","syncAuth","console","warn","encryptionKey","syncPeriod","readYourWrites","db","memory","readonly","name","open","Object","defineProperties","inTransaction","get","sync","call","syncUntil","replicationIndex","prepare","sql","stmt","Statement","transaction","fn","TypeError","wrapTxn","mode","bindParameters","exec","result","properties","default","value","deferred","immediate","exclusive","database","enumerable","pragma","source","options","simple","pluck","all","backup","filename","Error","serialize","function","aggregate","table","factory","loadExtension","args","maxWriteReplicationIndex","close","defaultSafeIntegers","toggle","unsafeMode","raw","reader","run","length","flat","iterate","rows","undefined","iter","nextRows","Array","nextRowIndex","next","row","done","Symbol","iterator","push","columns","safeIntegers","module","exports"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/libsql/index.js"],"sourcesContent":["\"use strict\";\n\nconst { load, currentTarget } = require(\"@neon-rs/load\");\nconst { familySync, GLIBC } = require(\"detect-libc\");\n\nfunction requireNative() {\n if (process.env.LIBSQL_JS_DEV) {\n return load(__dirname)\n }\n let target = currentTarget();\n // Workaround for Bun, which reports a musl target, but really wants glibc...\n if (familySync() == GLIBC) {\n switch (target) {\n case \"linux-x64-musl\":\n target = \"linux-x64-gnu\";\n break;\n case \"linux-arm64-musl\":\n target = \"linux-arm64-gnu\";\n break;\n }\n }\n return require(`@libsql/${target}`);\n}\n\nconst {\n databaseOpen,\n databaseOpenWithRpcSync,\n databaseInTransaction,\n databaseClose,\n databaseSyncSync,\n databaseSyncUntilSync,\n databaseExecSync,\n databasePrepareSync,\n databaseDefaultSafeIntegers,\n databaseLoadExtension,\n databaseMaxWriteReplicationIndex,\n statementRaw,\n statementIsReader,\n statementGet,\n statementRun,\n statementRowsSync,\n statementColumns,\n statementSafeIntegers,\n rowsNext,\n} = requireNative();\n\nconst SqliteError = require(\"./sqlite-error\");\n\nfunction convertError(err) {\n if (err.libsqlError) {\n return new SqliteError(err.message, err.code, err.rawCode);\n }\n return err;\n}\n\n/**\n * Database represents a connection that can prepare and execute SQL statements.\n */\nclass Database {\n /**\n * Creates a new database connection. If the database file pointed to by `path` does not exists, it will be created.\n *\n * @constructor\n * @param {string} path - Path to the database file.\n */\n constructor(path, opts) {\n const encryptionCipher = opts?.encryptionCipher ?? \"aes256cbc\";\n if (opts && opts.syncUrl) {\n var authToken = \"\";\n if (opts.syncAuth) {\n console.warn(\"Warning: The `syncAuth` option is deprecated, please use `authToken` option instead.\");\n authToken = opts.syncAuth;\n } else if (opts.authToken) {\n authToken = opts.authToken;\n }\n const encryptionKey = opts?.encryptionKey ?? \"\";\n const syncPeriod = opts?.syncPeriod ?? 0.0;\n const readYourWrites = opts?.readYourWrites ?? true;\n this.db = databaseOpenWithRpcSync(path, opts.syncUrl, authToken, encryptionCipher, encryptionKey, syncPeriod, readYourWrites);\n } else {\n const authToken = opts?.authToken ?? \"\";\n const encryptionKey = opts?.encryptionKey ?? \"\";\n this.db = databaseOpen(path, authToken, encryptionCipher, encryptionKey);\n }\n // TODO: Use a libSQL API for this?\n this.memory = path === \":memory:\";\n this.readonly = false;\n this.name = \"\";\n this.open = true;\n\n const db = this.db;\n Object.defineProperties(this, {\n inTransaction: {\n get() {\n return databaseInTransaction(db);\n }\n },\n });\n }\n\n sync() {\n return databaseSyncSync.call(this.db);\n }\n\n syncUntil(replicationIndex) {\n return databaseSyncUntilSync.call(this.db, replicationIndex);\n }\n\n /**\n * Prepares a SQL statement for execution.\n *\n * @param {string} sql - The SQL statement string to prepare.\n */\n prepare(sql) {\n try {\n const stmt = databasePrepareSync.call(this.db, sql);\n return new Statement(stmt); \n } catch (err) {\n throw convertError(err);\n }\n }\n\n /**\n * Returns a function that executes the given function in a transaction.\n *\n * @param {function} fn - The function to wrap in a transaction.\n */\n transaction(fn) {\n if (typeof fn !== \"function\")\n throw new TypeError(\"Expected first argument to be a function\");\n\n const db = this;\n const wrapTxn = (mode) => {\n return (...bindParameters) => {\n db.exec(\"BEGIN \" + mode);\n try {\n const result = fn(...bindParameters);\n db.exec(\"COMMIT\");\n return result;\n } catch (err) {\n db.exec(\"ROLLBACK\");\n throw err;\n }\n };\n };\n const properties = {\n default: { value: wrapTxn(\"\") },\n deferred: { value: wrapTxn(\"DEFERRED\") },\n immediate: { value: wrapTxn(\"IMMEDIATE\") },\n exclusive: { value: wrapTxn(\"EXCLUSIVE\") },\n database: { value: this, enumerable: true },\n };\n Object.defineProperties(properties.default.value, properties);\n Object.defineProperties(properties.deferred.value, properties);\n Object.defineProperties(properties.immediate.value, properties);\n Object.defineProperties(properties.exclusive.value, properties);\n return properties.default.value;\n }\n\n pragma(source, options) {\n if (options == null) options = {};\n if (typeof source !== 'string') throw new TypeError('Expected first argument to be a string');\n if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');\n const simple = options['simple'];\n const stmt = this.prepare(`PRAGMA ${source}`, this, true);\n return simple ? stmt.pluck().get() : stmt.all();\n }\n\n backup(filename, options) {\n throw new Error(\"not implemented\");\n }\n\n serialize(options) {\n throw new Error(\"not implemented\");\n }\n\n function(name, options, fn) {\n // Apply defaults\n if (options == null) options = {};\n if (typeof options === \"function\") {\n fn = options;\n options = {};\n }\n\n // Validate arguments\n if (typeof name !== \"string\")\n throw new TypeError(\"Expected first argument to be a string\");\n if (typeof fn !== \"function\")\n throw new TypeError(\"Expected last argument to be a function\");\n if (typeof options !== \"object\")\n throw new TypeError(\"Expected second argument to be an options object\");\n if (!name)\n throw new TypeError(\n \"User-defined function name cannot be an empty string\"\n );\n\n throw new Error(\"not implemented\");\n }\n\n aggregate(name, options) {\n // Validate arguments\n if (typeof name !== \"string\")\n throw new TypeError(\"Expected first argument to be a string\");\n if (typeof options !== \"object\" || options === null)\n throw new TypeError(\"Expected second argument to be an options object\");\n if (!name)\n throw new TypeError(\n \"User-defined function name cannot be an empty string\"\n );\n\n throw new Error(\"not implemented\");\n }\n\n table(name, factory) {\n // Validate arguments\n if (typeof name !== \"string\")\n throw new TypeError(\"Expected first argument to be a string\");\n if (!name)\n throw new TypeError(\n \"Virtual table module name cannot be an empty string\"\n );\n\n throw new Error(\"not implemented\");\n }\n\n loadExtension(...args) {\n databaseLoadExtension.call(this.db, ...args);\n }\n\n maxWriteReplicationIndex() {\n return databaseMaxWriteReplicationIndex.call(this.db)\n }\n\n /**\n * Executes a SQL statement.\n *\n * @param {string} sql - The SQL statement string to execute.\n */\n exec(sql) {\n try {\n databaseExecSync.call(this.db, sql);\n } catch (err) {\n throw convertError(err);\n }\n }\n\n /**\n * Closes the database connection.\n */\n close() {\n databaseClose.call(this.db);\n this.open = false;\n }\n\n /**\n * Toggle 64-bit integer support.\n */\n defaultSafeIntegers(toggle) {\n databaseDefaultSafeIntegers.call(this.db, toggle ?? true);\n return this;\n }\n\n unsafeMode(...args) {\n throw new Error(\"not implemented\");\n }\n}\n\n/**\n * Statement represents a prepared SQL statement that can be executed.\n */\nclass Statement {\n constructor(stmt) {\n this.stmt = stmt;\n }\n\n /**\n * Toggle raw mode.\n *\n * @param raw Enable or disable raw mode. If you don't pass the parameter, raw mode is enabled.\n */\n raw(raw) {\n statementRaw.call(this.stmt, raw ?? true);\n return this;\n }\n\n get reader() {\n return statementIsReader.call(this.stmt);\n }\n\n /**\n * Executes the SQL statement and returns an info object.\n */\n run(...bindParameters) {\n try {\n if (bindParameters.length == 1 && typeof bindParameters[0] === \"object\") {\n return statementRun.call(this.stmt, bindParameters[0]);\n } else {\n return statementRun.call(this.stmt, bindParameters.flat());\n } \n } catch (err) {\n throw convertError(err);\n }\n }\n\n /**\n * Executes the SQL statement and returns the first row.\n *\n * @param bindParameters - The bind parameters for executing the statement.\n */\n get(...bindParameters) {\n if (bindParameters.length == 1 && typeof bindParameters[0] === \"object\") {\n return statementGet.call(this.stmt, bindParameters[0]);\n } else {\n return statementGet.call(this.stmt, bindParameters.flat());\n }\n }\n\n /**\n * Executes the SQL statement and returns an iterator to the resulting rows.\n *\n * @param bindParameters - The bind parameters for executing the statement.\n */\n iterate(...bindParameters) {\n var rows = undefined;\n if (bindParameters.length == 1 && typeof bindParameters[0] === \"object\") {\n rows = statementRowsSync.call(this.stmt, bindParameters[0]);\n } else {\n rows = statementRowsSync.call(this.stmt, bindParameters.flat());\n }\n const iter = {\n nextRows: Array(100),\n nextRowIndex: 100,\n next() {\n if (this.nextRowIndex === 100) {\n rowsNext.call(rows, this.nextRows);\n this.nextRowIndex = 0;\n }\n const row = this.nextRows[this.nextRowIndex];\n this.nextRows[this.nextRowIndex] = undefined;\n if (!row) {\n return { done: true };\n }\n this.nextRowIndex++;\n return { value: row, done: false };\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n return iter;\n }\n\n /**\n * Executes the SQL statement and returns an array of the resulting rows.\n *\n * @param bindParameters - The bind parameters for executing the statement.\n */\n all(...bindParameters) {\n const result = [];\n for (const row of this.iterate(...bindParameters)) {\n result.push(row);\n }\n return result;\n }\n\n /**\n * Returns the columns in the result set returned by this prepared statement.\n */\n columns() {\n return statementColumns.call(this.stmt);\n }\n\n /**\n * Toggle 64-bit integer support.\n */\n safeIntegers(toggle) {\n statementSafeIntegers.call(this.stmt, toggle ?? true);\n return this;\n }\n}\n\nmodule.exports = Database;\nmodule.exports.SqliteError = SqliteError;\n"],"mappings":"AAAA,YAAY;;AAEZ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