A Node.js adapter for PawSQLite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1 lines
3.9 KiB

{"version":3,"sources":["webpack://pawsqlite-node-adapter/./src/log.mjs","webpack://pawsqlite-node-adapter/./src/node_adapter_error.mjs","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":";;;;;;;;;;;;;;;AAAA;;AAEO;AACP;AACA;AACA,G;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;;;ACbO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;UCRA;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;AACf;;AAE7C;;AAEA,iEAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,UAAU;AACjD,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH,SAAS,iDAAW;AACpB,CAAC,EAAC","file":"pawsqlite-node-adapter.js","sourcesContent":["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-WebSQL-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}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { NodeAdapterError } from \"./node_adapter_error.mjs\";\nimport { enableDebug, log } from \"./log.mjs\";\n\nconst databases = new Map();\n\nexport default {\n name: \"PawSQLiteNodeAdapter\",\n open: async (dbName) => {\n // const version = \"1.0\";\n\n // if (!databases.has(dbName)) {\n // databases.set(dbName, new DatabaseWrapper(dbName, version));\n // }\n\n // return ResponseWrapper.success({ version });\n },\n\n close: async (dbName) => {\n // databases.delete(dbName);\n // return ResponseWrapper.success();\n },\n\n sql: async (dbName, sql, ...args) => {\n // log(sql);\n\n // const db = databases.get(dbName);\n // if (!db) {\n // throw new NodeAdapterError(\"Database not open\");\n // }\n\n // const result = await db.sql(sql, ...args);\n // return ResponseWrapper.success(result);\n },\n\n delete: async (dbName) => {\n // throw new NodeAdapterError(\"Delete not implemented\");\n },\n\n debug: enableDebug\n};\n"],"sourceRoot":""}