2021-03-14 22:57:17 -07:00
|
|
|
{"version":3,"sources":["webpack://pawsqlite-node-adapter/./src/database_wrapper.mjs","webpack://pawsqlite-node-adapter/./src/log.mjs","webpack://pawsqlite-node-adapter/./src/node_adapter_error.mjs","webpack://pawsqlite-node-adapter/./src/query_wrapper.mjs","webpack://pawsqlite-node-adapter/./src/response_wrapper.mjs","webpack://pawsqlite-node-adapter/external \"sqlite3\"","webpack://pawsqlite-node-adapter/webpack/bootstrap","webpack://pawsqlite-node-adapter/webpack/runtime/define property getters","webpack://pawsqlite-node-adapter/webpack/runtime/hasOwnProperty shorthand","webpack://pawsqlite-node-adapter/webpack/runtime/make namespace object","webpack://pawsqlite-node-adapter/./src/node_adapter.mjs"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAA8B;;AAE8B;AACT;AACnB;;;AAGzB;AACP;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,6CAAgB;AACrC;AACA,QAAQ,mDAAsB,GAAG,gDAAmB;AACpD;AACA;AACA,mBAAmB,0EAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,0EAAqB;AACtC;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA,sBAAsB,4DAAY;AAClC;AACA;;AAEA,C;;;;;;;;;;;;;;;AC9CA;;AAEO;AACP;AACA;AACA,G;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;;;ACbO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;;;;;;ACR4D;AACH;AACzB;;;AAGzB;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA,MAAM,6CAAG;AACT;AACA;AACA,iBAAiB,0EAAqB;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,0EAAuB;AACvC,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA,MAAM,6CAAG;AACT;AACA;AACA,iBAAiB,0EAAqB;AACtC;AACA;AACA,gBAAgB,0EAAuB,EAAE,KAAK;AAC9C,OAAO;AACP,KAAK;AACL;AACA,C;;;;;;;;;;;;;;ACnEO;AACP,oBAAoB;AACpB;AACA;AACA,GAAG;AACH,E;;;;;;;;;;ACLA,qC;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;;;;;;;;;;;;;;;ACN4D;AACH;AACA;AACZ;;AAE7C;;AAEO;AACP;AACA;AACA;AACA,qBAAqB,kEAAe;AACpC;AACA;AACA;;AAEA,WAAW,0EAAuB;AAClC,GAAG;;AAEH;AACA;AACA;AACA;;AAEA,WAAW,0EAAuB;AAClC,GAAG;;AAEH;AACA;AACA;;AAEA,WAAW,0EAAuB;AAClC,GAAG;;AAEH;AACA,cAAc,qEAAgB;AAC9B,GAAG;;AAEH,SAAS,iDAAW;AACpB;;;AAGA;AACA;AACA;AACA,cAAc,qEAAgB;AAC9B;AACA;AACA,C","file":"pawsqlite-node-adapter.js","sourcesContent":["import sqlite3 from \"sqlite3\";\n\nimport { NodeAdapterError } from \"./node_adapter_error.mjs\";\nimport { QueryWrapper } from \"./query_wrapper.mjs\";\nimport { log } from \"./log.mjs\";\n\n\nexport class DatabaseWrapper {\n constructor(dbName) {\n this.dbName = dbName;\n }\n\n open() {\n return new Promise((resolve, reject) => {\n const db = new sqlite3.Database(\n this.dbName,\n sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE,\n (err) => {\n if (err) {\n reject(NodeAdapterError.from(err));\n return;\n }\n this.db = db;\n resolve();\n }\n );\n });\n }\n\n close() {\n return new Promise((resolve, reject) => {\n this.db.close((err) => {\n if (err) {\n reject(NodeAdapterError.from(err));\n return;\n }\n resolve();\n });\n });\n }\n\n sql(sql, ...args) {\n const query = new QueryWrapper(sql, ...args);\n return query.execute(this.db);\n }\n\n}","let DEBUG = false;\n\nexport function log(...args) {\n if (DEBUG) {\n console.log(...args);\n } \n}\n\nexport function enableDebug(active) {\n DEBUG = !!active;\n log(\"PawSQLite-Node-Adapter: debugging \" + (\n DEBUG ? \"enabled\" : \"disabled\")\n );\n}","export class NodeAdapterError extends Error {\n static from(e) {\n let message = \"\";\n if (e && e.message) {\n message = e.message;\n }\n return new NodeAdapterError(message);\n }\n}","import { NodeAdapterError } from \"./node_adapter_error.mjs\";\nimport { ResponseWrapper } from \"./response_wrapper.mjs\";\nimport { log } from \"./log.mjs\";\n\n\nexport class QueryWrapper {\n constructor(sql, ...args) {\n this.sql = sq
|