@savecontext/dashboard 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/.next/standalone/dashboard/.next/BUILD_ID +1 -1
  2. package/.next/standalone/dashboard/.next/app-path-routes-manifest.json +22 -22
  3. package/.next/standalone/dashboard/.next/build-manifest.json +2 -2
  4. package/.next/standalone/dashboard/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  5. package/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
  6. package/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  9. package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  10. package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/dashboard/.next/server/app/_not-found.html +17 -1
  15. package/.next/standalone/dashboard/.next/server/app/_not-found.rsc +1 -1
  16. package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  17. package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  19. package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  22. package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route.js +1 -1
  23. package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route.js.nft.json +1 -1
  24. package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/dashboard/.next/server/app/api/context/delete/route.js +1 -1
  26. package/.next/standalone/dashboard/.next/server/app/api/context/delete/route.js.nft.json +1 -1
  27. package/.next/standalone/dashboard/.next/server/app/api/context/delete/route_client-reference-manifest.js +1 -1
  28. package/.next/standalone/dashboard/.next/server/app/api/context/update/route.js +1 -1
  29. package/.next/standalone/dashboard/.next/server/app/api/context/update/route.js.nft.json +1 -1
  30. package/.next/standalone/dashboard/.next/server/app/api/context/update/route_client-reference-manifest.js +1 -1
  31. package/.next/standalone/dashboard/.next/server/app/api/issues/create/route.js +2 -2
  32. package/.next/standalone/dashboard/.next/server/app/api/issues/create/route.js.nft.json +1 -1
  33. package/.next/standalone/dashboard/.next/server/app/api/issues/create/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route.js +2 -2
  35. package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route.js.nft.json +1 -1
  36. package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/dashboard/.next/server/app/api/issues/list/route.js +1 -1
  38. package/.next/standalone/dashboard/.next/server/app/api/issues/list/route.js.nft.json +1 -1
  39. package/.next/standalone/dashboard/.next/server/app/api/issues/list/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route.js +4 -4
  41. package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route.js.nft.json +1 -1
  42. package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/dashboard/.next/server/app/api/issues/update/route.js +2 -2
  44. package/.next/standalone/dashboard/.next/server/app/api/issues/update/route.js.nft.json +1 -1
  45. package/.next/standalone/dashboard/.next/server/app/api/issues/update/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route.js +1 -1
  47. package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route.js.nft.json +1 -1
  48. package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route_client-reference-manifest.js +1 -1
  49. package/.next/standalone/dashboard/.next/server/app/api/memory/list/route.js +1 -1
  50. package/.next/standalone/dashboard/.next/server/app/api/memory/list/route.js.nft.json +1 -1
  51. package/.next/standalone/dashboard/.next/server/app/api/memory/list/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/dashboard/.next/server/app/api/memory/save/route.js +1 -1
  53. package/.next/standalone/dashboard/.next/server/app/api/memory/save/route.js.nft.json +1 -1
  54. package/.next/standalone/dashboard/.next/server/app/api/memory/save/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route.js +1 -1
  56. package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route.js.nft.json +1 -1
  57. package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/dashboard/.next/server/app/api/plans/create/route.js +2 -2
  59. package/.next/standalone/dashboard/.next/server/app/api/plans/create/route.js.nft.json +1 -1
  60. package/.next/standalone/dashboard/.next/server/app/api/plans/create/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route.js +1 -1
  62. package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route.js.nft.json +1 -1
  63. package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/dashboard/.next/server/app/api/plans/list/route.js +1 -1
  65. package/.next/standalone/dashboard/.next/server/app/api/plans/list/route.js.nft.json +1 -1
  66. package/.next/standalone/dashboard/.next/server/app/api/plans/list/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/dashboard/.next/server/app/api/plans/update/route.js +2 -2
  68. package/.next/standalone/dashboard/.next/server/app/api/plans/update/route.js.nft.json +1 -1
  69. package/.next/standalone/dashboard/.next/server/app/api/plans/update/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route.js +1 -1
  71. package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  72. package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/dashboard/.next/server/app/api/projects/route.js +1 -1
  74. package/.next/standalone/dashboard/.next/server/app/api/projects/route.js.nft.json +1 -1
  75. package/.next/standalone/dashboard/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route.js +1 -1
  77. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route.js.nft.json +1 -1
  78. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route.js +1 -1
  80. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  81. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route.js +1 -1
  83. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route.js.nft.json +1 -1
  84. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route.js +1 -1
  86. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route.js.nft.json +1 -1
  87. package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page.js +1 -1
  89. package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page.js.nft.json +1 -1
  90. package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page_client-reference-manifest.js +1 -1
  91. package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page.js +2 -2
  92. package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page.js.nft.json +1 -1
  93. package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page_client-reference-manifest.js +1 -1
  94. package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page.js +1 -1
  95. package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page.js.nft.json +1 -1
  96. package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page_client-reference-manifest.js +1 -1
  97. package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page.js +2 -2
  98. package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page.js.nft.json +1 -1
  99. package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page_client-reference-manifest.js +1 -1
  100. package/.next/standalone/dashboard/.next/server/app/dashboard/page.js +3 -3
  101. package/.next/standalone/dashboard/.next/server/app/dashboard/page.js.nft.json +1 -1
  102. package/.next/standalone/dashboard/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  103. package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page.js +2 -2
  104. package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page.js.nft.json +1 -1
  105. package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page_client-reference-manifest.js +1 -1
  106. package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page.js +1 -1
  107. package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page.js.nft.json +1 -1
  108. package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
  109. package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page.js +1 -1
  110. package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page.js.nft.json +1 -1
  111. package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page_client-reference-manifest.js +1 -1
  112. package/.next/standalone/dashboard/.next/server/app/index.html +1 -1
  113. package/.next/standalone/dashboard/.next/server/app/index.rsc +1 -1
  114. package/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  115. package/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +1 -1
  116. package/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
  117. package/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +1 -1
  118. package/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  119. package/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  120. package/.next/standalone/dashboard/.next/server/app-paths-manifest.json +22 -22
  121. package/.next/standalone/dashboard/.next/server/chunks/848.js +1 -1
  122. package/.next/standalone/dashboard/.next/server/pages/404.html +17 -1
  123. package/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
  124. package/.next/standalone/dashboard/.next/static/chunks/{3358-27a1941db2941343.js → 3358-be1dcb412e5a5840.js} +1 -1
  125. package/.next/standalone/dashboard/.next/static/chunks/{5602-66df072f21a844c9.js → 5602-de6be5d495e39d30.js} +1 -1
  126. package/.next/standalone/dashboard/.next/static/chunks/{6736-41f13829c40765d8.js → 6736-2e5d92a3f8a9a938.js} +1 -1
  127. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/checkpoints/{page-4b30b30c441a24c8.js → page-69c93b249f9f09f9.js} +1 -1
  128. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-b176cdca78e8145d.js +1 -0
  129. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/memory/{page-5b92aff45809fc6f.js → page-ffbe55f2b5b3a1a4.js} +1 -1
  130. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/{page-8403ee5d448ed5a7.js → page-e7dfa69451ac3cf4.js} +2 -2
  131. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/plans/{page-5203a84d31f5998c.js → page-aa014387d68c52ed.js} +1 -1
  132. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/[id]/{page-094d2405b39c79d3.js → page-1acf5db28461761f.js} +1 -1
  133. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/page-bce106da597ef37a.js +1 -0
  134. package/.next/standalone/dashboard/package.json +8 -9
  135. package/.next/standalone/package.json +1 -1
  136. package/README.md +3 -5
  137. package/bin/savecontext-dashboard.js +6 -5
  138. package/package.json +8 -9
  139. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-8595961148b9e336.js +0 -1
  140. package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/page-a6e839598a743003.js +0 -1
  141. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  142. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/database.js +0 -90
  143. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/index.js +0 -3
  144. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
  145. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
  146. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/function.js +0 -31
  147. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
  148. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
  149. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
  150. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/table.js +0 -189
  151. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
  152. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
  153. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
  154. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/util.js +0 -12
  155. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/package.json +0 -59
  156. package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js +0 -221
  157. package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/package.json +0 -28
  158. package/.next/standalone/node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/index.js +0 -66
  159. package/.next/standalone/node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/package.json +0 -32
  160. package/.next/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  161. package/.next/standalone/node_modules/better-sqlite3/lib/database.js +0 -90
  162. package/.next/standalone/node_modules/better-sqlite3/lib/index.js +0 -3
  163. package/.next/standalone/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
  164. package/.next/standalone/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
  165. package/.next/standalone/node_modules/better-sqlite3/lib/methods/function.js +0 -31
  166. package/.next/standalone/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
  167. package/.next/standalone/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
  168. package/.next/standalone/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
  169. package/.next/standalone/node_modules/better-sqlite3/lib/methods/table.js +0 -189
  170. package/.next/standalone/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
  171. package/.next/standalone/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
  172. package/.next/standalone/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
  173. package/.next/standalone/node_modules/better-sqlite3/lib/util.js +0 -12
  174. package/.next/standalone/node_modules/better-sqlite3/package.json +0 -59
  175. package/.next/standalone/node_modules/bindings/bindings.js +0 -221
  176. package/.next/standalone/node_modules/bindings/package.json +0 -28
  177. package/.next/standalone/node_modules/file-uri-to-path/index.js +0 -66
  178. package/.next/standalone/node_modules/file-uri-to-path/package.json +0 -32
  179. /package/.next/standalone/dashboard/.next/static/{iXCD4qusgLaFdlD22YBUR → 00P-K7nRwpuQW1hq0VwZ5}/_buildManifest.js +0 -0
  180. /package/.next/standalone/dashboard/.next/static/{iXCD4qusgLaFdlD22YBUR → 00P-K7nRwpuQW1hq0VwZ5}/_ssgManifest.js +0 -0
@@ -1,189 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
-
4
- module.exports = function defineTable(name, factory) {
5
- // Validate arguments
6
- if (typeof name !== 'string') throw new TypeError('Expected first argument to be a string');
7
- if (!name) throw new TypeError('Virtual table module name cannot be an empty string');
8
-
9
- // Determine whether the module is eponymous-only or not
10
- let eponymous = false;
11
- if (typeof factory === 'object' && factory !== null) {
12
- eponymous = true;
13
- factory = defer(parseTableDefinition(factory, 'used', name));
14
- } else {
15
- if (typeof factory !== 'function') throw new TypeError('Expected second argument to be a function or a table definition object');
16
- factory = wrapFactory(factory);
17
- }
18
-
19
- this[cppdb].table(factory, name, eponymous);
20
- return this;
21
- };
22
-
23
- function wrapFactory(factory) {
24
- return function virtualTableFactory(moduleName, databaseName, tableName, ...args) {
25
- const thisObject = {
26
- module: moduleName,
27
- database: databaseName,
28
- table: tableName,
29
- };
30
-
31
- // Generate a new table definition by invoking the factory
32
- const def = apply.call(factory, thisObject, args);
33
- if (typeof def !== 'object' || def === null) {
34
- throw new TypeError(`Virtual table module "${moduleName}" did not return a table definition object`);
35
- }
36
-
37
- return parseTableDefinition(def, 'returned', moduleName);
38
- };
39
- }
40
-
41
- function parseTableDefinition(def, verb, moduleName) {
42
- // Validate required properties
43
- if (!hasOwnProperty.call(def, 'rows')) {
44
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "rows" property`);
45
- }
46
- if (!hasOwnProperty.call(def, 'columns')) {
47
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "columns" property`);
48
- }
49
-
50
- // Validate "rows" property
51
- const rows = def.rows;
52
- if (typeof rows !== 'function' || Object.getPrototypeOf(rows) !== GeneratorFunctionPrototype) {
53
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "rows" property (should be a generator function)`);
54
- }
55
-
56
- // Validate "columns" property
57
- let columns = def.columns;
58
- if (!Array.isArray(columns) || !(columns = [...columns]).every(x => typeof x === 'string')) {
59
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "columns" property (should be an array of strings)`);
60
- }
61
- if (columns.length !== new Set(columns).size) {
62
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate column names`);
63
- }
64
- if (!columns.length) {
65
- throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with zero columns`);
66
- }
67
-
68
- // Validate "parameters" property
69
- let parameters;
70
- if (hasOwnProperty.call(def, 'parameters')) {
71
- parameters = def.parameters;
72
- if (!Array.isArray(parameters) || !(parameters = [...parameters]).every(x => typeof x === 'string')) {
73
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "parameters" property (should be an array of strings)`);
74
- }
75
- } else {
76
- parameters = inferParameters(rows);
77
- }
78
- if (parameters.length !== new Set(parameters).size) {
79
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate parameter names`);
80
- }
81
- if (parameters.length > 32) {
82
- throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with more than the maximum number of 32 parameters`);
83
- }
84
- for (const parameter of parameters) {
85
- if (columns.includes(parameter)) {
86
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with column "${parameter}" which was ambiguously defined as both a column and parameter`);
87
- }
88
- }
89
-
90
- // Validate "safeIntegers" option
91
- let safeIntegers = 2;
92
- if (hasOwnProperty.call(def, 'safeIntegers')) {
93
- const bool = def.safeIntegers;
94
- if (typeof bool !== 'boolean') {
95
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "safeIntegers" property (should be a boolean)`);
96
- }
97
- safeIntegers = +bool;
98
- }
99
-
100
- // Validate "directOnly" option
101
- let directOnly = false;
102
- if (hasOwnProperty.call(def, 'directOnly')) {
103
- directOnly = def.directOnly;
104
- if (typeof directOnly !== 'boolean') {
105
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "directOnly" property (should be a boolean)`);
106
- }
107
- }
108
-
109
- // Generate SQL for the virtual table definition
110
- const columnDefinitions = [
111
- ...parameters.map(identifier).map(str => `${str} HIDDEN`),
112
- ...columns.map(identifier),
113
- ];
114
- return [
115
- `CREATE TABLE x(${columnDefinitions.join(', ')});`,
116
- wrapGenerator(rows, new Map(columns.map((x, i) => [x, parameters.length + i])), moduleName),
117
- parameters,
118
- safeIntegers,
119
- directOnly,
120
- ];
121
- }
122
-
123
- function wrapGenerator(generator, columnMap, moduleName) {
124
- return function* virtualTable(...args) {
125
- /*
126
- We must defensively clone any buffers in the arguments, because
127
- otherwise the generator could mutate one of them, which would cause
128
- us to return incorrect values for hidden columns, potentially
129
- corrupting the database.
130
- */
131
- const output = args.map(x => Buffer.isBuffer(x) ? Buffer.from(x) : x);
132
- for (let i = 0; i < columnMap.size; ++i) {
133
- output.push(null); // Fill with nulls to prevent gaps in array (v8 optimization)
134
- }
135
- for (const row of generator(...args)) {
136
- if (Array.isArray(row)) {
137
- extractRowArray(row, output, columnMap.size, moduleName);
138
- yield output;
139
- } else if (typeof row === 'object' && row !== null) {
140
- extractRowObject(row, output, columnMap, moduleName);
141
- yield output;
142
- } else {
143
- throw new TypeError(`Virtual table module "${moduleName}" yielded something that isn't a valid row object`);
144
- }
145
- }
146
- };
147
- }
148
-
149
- function extractRowArray(row, output, columnCount, moduleName) {
150
- if (row.length !== columnCount) {
151
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an incorrect number of columns`);
152
- }
153
- const offset = output.length - columnCount;
154
- for (let i = 0; i < columnCount; ++i) {
155
- output[i + offset] = row[i];
156
- }
157
- }
158
-
159
- function extractRowObject(row, output, columnMap, moduleName) {
160
- let count = 0;
161
- for (const key of Object.keys(row)) {
162
- const index = columnMap.get(key);
163
- if (index === undefined) {
164
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an undeclared column "${key}"`);
165
- }
166
- output[index] = row[key];
167
- count += 1;
168
- }
169
- if (count !== columnMap.size) {
170
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with missing columns`);
171
- }
172
- }
173
-
174
- function inferParameters({ length }) {
175
- if (!Number.isInteger(length) || length < 0) {
176
- throw new TypeError('Expected function.length to be a positive integer');
177
- }
178
- const params = [];
179
- for (let i = 0; i < length; ++i) {
180
- params.push(`$${i + 1}`);
181
- }
182
- return params;
183
- }
184
-
185
- const { hasOwnProperty } = Object.prototype;
186
- const { apply } = Function.prototype;
187
- const GeneratorFunctionPrototype = Object.getPrototypeOf(function*(){});
188
- const identifier = str => `"${str.replace(/"/g, '""')}"`;
189
- const defer = x => () => x;
@@ -1,78 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
- const controllers = new WeakMap();
4
-
5
- module.exports = function transaction(fn) {
6
- if (typeof fn !== 'function') throw new TypeError('Expected first argument to be a function');
7
-
8
- const db = this[cppdb];
9
- const controller = getController(db, this);
10
- const { apply } = Function.prototype;
11
-
12
- // Each version of the transaction function has these same properties
13
- const properties = {
14
- default: { value: wrapTransaction(apply, fn, db, controller.default) },
15
- deferred: { value: wrapTransaction(apply, fn, db, controller.deferred) },
16
- immediate: { value: wrapTransaction(apply, fn, db, controller.immediate) },
17
- exclusive: { value: wrapTransaction(apply, fn, db, controller.exclusive) },
18
- database: { value: this, enumerable: true },
19
- };
20
-
21
- Object.defineProperties(properties.default.value, properties);
22
- Object.defineProperties(properties.deferred.value, properties);
23
- Object.defineProperties(properties.immediate.value, properties);
24
- Object.defineProperties(properties.exclusive.value, properties);
25
-
26
- // Return the default version of the transaction function
27
- return properties.default.value;
28
- };
29
-
30
- // Return the database's cached transaction controller, or create a new one
31
- const getController = (db, self) => {
32
- let controller = controllers.get(db);
33
- if (!controller) {
34
- const shared = {
35
- commit: db.prepare('COMMIT', self, false),
36
- rollback: db.prepare('ROLLBACK', self, false),
37
- savepoint: db.prepare('SAVEPOINT `\t_bs3.\t`', self, false),
38
- release: db.prepare('RELEASE `\t_bs3.\t`', self, false),
39
- rollbackTo: db.prepare('ROLLBACK TO `\t_bs3.\t`', self, false),
40
- };
41
- controllers.set(db, controller = {
42
- default: Object.assign({ begin: db.prepare('BEGIN', self, false) }, shared),
43
- deferred: Object.assign({ begin: db.prepare('BEGIN DEFERRED', self, false) }, shared),
44
- immediate: Object.assign({ begin: db.prepare('BEGIN IMMEDIATE', self, false) }, shared),
45
- exclusive: Object.assign({ begin: db.prepare('BEGIN EXCLUSIVE', self, false) }, shared),
46
- });
47
- }
48
- return controller;
49
- };
50
-
51
- // Return a new transaction function by wrapping the given function
52
- const wrapTransaction = (apply, fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function sqliteTransaction() {
53
- let before, after, undo;
54
- if (db.inTransaction) {
55
- before = savepoint;
56
- after = release;
57
- undo = rollbackTo;
58
- } else {
59
- before = begin;
60
- after = commit;
61
- undo = rollback;
62
- }
63
- before.run();
64
- try {
65
- const result = apply.call(fn, this, arguments);
66
- if (result && typeof result.then === 'function') {
67
- throw new TypeError('Transaction function cannot return a promise');
68
- }
69
- after.run();
70
- return result;
71
- } catch (ex) {
72
- if (db.inTransaction) {
73
- undo.run();
74
- if (undo !== rollback) after.run();
75
- }
76
- throw ex;
77
- }
78
- };
@@ -1,54 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
-
4
- exports.prepare = function prepare(sql) {
5
- return this[cppdb].prepare(sql, this, false);
6
- };
7
-
8
- exports.exec = function exec(sql) {
9
- this[cppdb].exec(sql);
10
- return this;
11
- };
12
-
13
- exports.close = function close() {
14
- this[cppdb].close();
15
- return this;
16
- };
17
-
18
- exports.loadExtension = function loadExtension(...args) {
19
- this[cppdb].loadExtension(...args);
20
- return this;
21
- };
22
-
23
- exports.defaultSafeIntegers = function defaultSafeIntegers(...args) {
24
- this[cppdb].defaultSafeIntegers(...args);
25
- return this;
26
- };
27
-
28
- exports.unsafeMode = function unsafeMode(...args) {
29
- this[cppdb].unsafeMode(...args);
30
- return this;
31
- };
32
-
33
- exports.getters = {
34
- name: {
35
- get: function name() { return this[cppdb].name; },
36
- enumerable: true,
37
- },
38
- open: {
39
- get: function open() { return this[cppdb].open; },
40
- enumerable: true,
41
- },
42
- inTransaction: {
43
- get: function inTransaction() { return this[cppdb].inTransaction; },
44
- enumerable: true,
45
- },
46
- readonly: {
47
- get: function readonly() { return this[cppdb].readonly; },
48
- enumerable: true,
49
- },
50
- memory: {
51
- get: function memory() { return this[cppdb].memory; },
52
- enumerable: true,
53
- },
54
- };
@@ -1,20 +0,0 @@
1
- 'use strict';
2
- const descriptor = { value: 'SqliteError', writable: true, enumerable: false, configurable: true };
3
-
4
- function SqliteError(message, code) {
5
- if (new.target !== SqliteError) {
6
- return new SqliteError(message, code);
7
- }
8
- if (typeof code !== 'string') {
9
- throw new TypeError('Expected second argument to be a string');
10
- }
11
- Error.call(this, message);
12
- descriptor.value = '' + message;
13
- Object.defineProperty(this, 'message', descriptor);
14
- Error.captureStackTrace(this, SqliteError);
15
- this.code = code;
16
- }
17
- Object.setPrototypeOf(SqliteError, Error);
18
- Object.setPrototypeOf(SqliteError.prototype, Error.prototype);
19
- Object.defineProperty(SqliteError.prototype, 'name', descriptor);
20
- module.exports = SqliteError;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- exports.getBooleanOption = (options, key) => {
4
- let value = false;
5
- if (key in options && typeof (value = options[key]) !== 'boolean') {
6
- throw new TypeError(`Expected the "${key}" option to be a boolean`);
7
- }
8
- return value;
9
- };
10
-
11
- exports.cppdb = Symbol();
12
- exports.inspect = Symbol.for('nodejs.util.inspect.custom');
@@ -1,59 +0,0 @@
1
- {
2
- "name": "better-sqlite3",
3
- "version": "12.5.0",
4
- "description": "The fastest and simplest library for SQLite in Node.js.",
5
- "homepage": "http://github.com/WiseLibs/better-sqlite3",
6
- "author": "Joshua Wise <joshuathomaswise@gmail.com>",
7
- "repository": {
8
- "type": "git",
9
- "url": "git://github.com/WiseLibs/better-sqlite3.git"
10
- },
11
- "main": "lib/index.js",
12
- "files": [
13
- "binding.gyp",
14
- "src/**/*.[ch]pp",
15
- "lib/**",
16
- "deps/**"
17
- ],
18
- "engines": {
19
- "node": "20.x || 22.x || 23.x || 24.x || 25.x"
20
- },
21
- "dependencies": {
22
- "bindings": "^1.5.0",
23
- "prebuild-install": "^7.1.1"
24
- },
25
- "overrides": {
26
- "prebuild": {
27
- "node-abi": "4.15.0"
28
- }
29
- },
30
- "devDependencies": {
31
- "chai": "^4.3.8",
32
- "cli-color": "^2.0.3",
33
- "fs-extra": "^11.1.1",
34
- "mocha": "^10.2.0",
35
- "nodemark": "^0.3.0",
36
- "prebuild": "^13.0.1",
37
- "sqlite": "^5.0.1",
38
- "sqlite3": "^5.1.6"
39
- },
40
- "scripts": {
41
- "install": "prebuild-install || node-gyp rebuild --release",
42
- "build-release": "node-gyp rebuild --release",
43
- "build-debug": "node-gyp rebuild --debug",
44
- "test": "mocha --exit --slow=75 --timeout=5000",
45
- "benchmark": "node benchmark",
46
- "download": "bash ./deps/download.sh"
47
- },
48
- "license": "MIT",
49
- "keywords": [
50
- "sql",
51
- "sqlite",
52
- "sqlite3",
53
- "transactions",
54
- "user-defined functions",
55
- "aggregate functions",
56
- "window functions",
57
- "database"
58
- ]
59
- }
@@ -1,221 +0,0 @@
1
- /**
2
- * Module dependencies.
3
- */
4
-
5
- var fs = require('fs'),
6
- path = require('path'),
7
- fileURLToPath = require('file-uri-to-path'),
8
- join = path.join,
9
- dirname = path.dirname,
10
- exists =
11
- (fs.accessSync &&
12
- function(path) {
13
- try {
14
- fs.accessSync(path);
15
- } catch (e) {
16
- return false;
17
- }
18
- return true;
19
- }) ||
20
- fs.existsSync ||
21
- path.existsSync,
22
- defaults = {
23
- arrow: process.env.NODE_BINDINGS_ARROW || ' → ',
24
- compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',
25
- platform: process.platform,
26
- arch: process.arch,
27
- nodePreGyp:
28
- 'node-v' +
29
- process.versions.modules +
30
- '-' +
31
- process.platform +
32
- '-' +
33
- process.arch,
34
- version: process.versions.node,
35
- bindings: 'bindings.node',
36
- try: [
37
- // node-gyp's linked version in the "build" dir
38
- ['module_root', 'build', 'bindings'],
39
- // node-waf and gyp_addon (a.k.a node-gyp)
40
- ['module_root', 'build', 'Debug', 'bindings'],
41
- ['module_root', 'build', 'Release', 'bindings'],
42
- // Debug files, for development (legacy behavior, remove for node v0.9)
43
- ['module_root', 'out', 'Debug', 'bindings'],
44
- ['module_root', 'Debug', 'bindings'],
45
- // Release files, but manually compiled (legacy behavior, remove for node v0.9)
46
- ['module_root', 'out', 'Release', 'bindings'],
47
- ['module_root', 'Release', 'bindings'],
48
- // Legacy from node-waf, node <= 0.4.x
49
- ['module_root', 'build', 'default', 'bindings'],
50
- // Production "Release" buildtype binary (meh...)
51
- ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],
52
- // node-qbs builds
53
- ['module_root', 'addon-build', 'release', 'install-root', 'bindings'],
54
- ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'],
55
- ['module_root', 'addon-build', 'default', 'install-root', 'bindings'],
56
- // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
57
- ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']
58
- ]
59
- };
60
-
61
- /**
62
- * The main `bindings()` function loads the compiled bindings for a given module.
63
- * It uses V8's Error API to determine the parent filename that this function is
64
- * being invoked from, which is then used to find the root directory.
65
- */
66
-
67
- function bindings(opts) {
68
- // Argument surgery
69
- if (typeof opts == 'string') {
70
- opts = { bindings: opts };
71
- } else if (!opts) {
72
- opts = {};
73
- }
74
-
75
- // maps `defaults` onto `opts` object
76
- Object.keys(defaults).map(function(i) {
77
- if (!(i in opts)) opts[i] = defaults[i];
78
- });
79
-
80
- // Get the module root
81
- if (!opts.module_root) {
82
- opts.module_root = exports.getRoot(exports.getFileName());
83
- }
84
-
85
- // Ensure the given bindings name ends with .node
86
- if (path.extname(opts.bindings) != '.node') {
87
- opts.bindings += '.node';
88
- }
89
-
90
- // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
91
- var requireFunc =
92
- typeof __webpack_require__ === 'function'
93
- ? __non_webpack_require__
94
- : require;
95
-
96
- var tries = [],
97
- i = 0,
98
- l = opts.try.length,
99
- n,
100
- b,
101
- err;
102
-
103
- for (; i < l; i++) {
104
- n = join.apply(
105
- null,
106
- opts.try[i].map(function(p) {
107
- return opts[p] || p;
108
- })
109
- );
110
- tries.push(n);
111
- try {
112
- b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
113
- if (!opts.path) {
114
- b.path = n;
115
- }
116
- return b;
117
- } catch (e) {
118
- if (e.code !== 'MODULE_NOT_FOUND' &&
119
- e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&
120
- !/not find/i.test(e.message)) {
121
- throw e;
122
- }
123
- }
124
- }
125
-
126
- err = new Error(
127
- 'Could not locate the bindings file. Tried:\n' +
128
- tries
129
- .map(function(a) {
130
- return opts.arrow + a;
131
- })
132
- .join('\n')
133
- );
134
- err.tries = tries;
135
- throw err;
136
- }
137
- module.exports = exports = bindings;
138
-
139
- /**
140
- * Gets the filename of the JavaScript file that invokes this function.
141
- * Used to help find the root directory of a module.
142
- * Optionally accepts an filename argument to skip when searching for the invoking filename
143
- */
144
-
145
- exports.getFileName = function getFileName(calling_file) {
146
- var origPST = Error.prepareStackTrace,
147
- origSTL = Error.stackTraceLimit,
148
- dummy = {},
149
- fileName;
150
-
151
- Error.stackTraceLimit = 10;
152
-
153
- Error.prepareStackTrace = function(e, st) {
154
- for (var i = 0, l = st.length; i < l; i++) {
155
- fileName = st[i].getFileName();
156
- if (fileName !== __filename) {
157
- if (calling_file) {
158
- if (fileName !== calling_file) {
159
- return;
160
- }
161
- } else {
162
- return;
163
- }
164
- }
165
- }
166
- };
167
-
168
- // run the 'prepareStackTrace' function above
169
- Error.captureStackTrace(dummy);
170
- dummy.stack;
171
-
172
- // cleanup
173
- Error.prepareStackTrace = origPST;
174
- Error.stackTraceLimit = origSTL;
175
-
176
- // handle filename that starts with "file://"
177
- var fileSchema = 'file://';
178
- if (fileName.indexOf(fileSchema) === 0) {
179
- fileName = fileURLToPath(fileName);
180
- }
181
-
182
- return fileName;
183
- };
184
-
185
- /**
186
- * Gets the root directory of a module, given an arbitrary filename
187
- * somewhere in the module tree. The "root directory" is the directory
188
- * containing the `package.json` file.
189
- *
190
- * In: /home/nate/node-native-module/lib/index.js
191
- * Out: /home/nate/node-native-module
192
- */
193
-
194
- exports.getRoot = function getRoot(file) {
195
- var dir = dirname(file),
196
- prev;
197
- while (true) {
198
- if (dir === '.') {
199
- // Avoids an infinite loop in rare cases, like the REPL
200
- dir = process.cwd();
201
- }
202
- if (
203
- exists(join(dir, 'package.json')) ||
204
- exists(join(dir, 'node_modules'))
205
- ) {
206
- // Found the 'package.json' file or 'node_modules' dir; we're done
207
- return dir;
208
- }
209
- if (prev === dir) {
210
- // Got to the top
211
- throw new Error(
212
- 'Could not find module root given file: "' +
213
- file +
214
- '". Do you have a `package.json` file? '
215
- );
216
- }
217
- // Try the parent dir next
218
- prev = dir;
219
- dir = join(dir, '..');
220
- }
221
- };
@@ -1,28 +0,0 @@
1
- {
2
- "name": "bindings",
3
- "description": "Helper module for loading your native module's .node file",
4
- "keywords": [
5
- "native",
6
- "addon",
7
- "bindings",
8
- "gyp",
9
- "waf",
10
- "c",
11
- "c++"
12
- ],
13
- "version": "1.5.0",
14
- "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
15
- "repository": {
16
- "type": "git",
17
- "url": "git://github.com/TooTallNate/node-bindings.git"
18
- },
19
- "main": "./bindings.js",
20
- "bugs": {
21
- "url": "https://github.com/TooTallNate/node-bindings/issues"
22
- },
23
- "homepage": "https://github.com/TooTallNate/node-bindings",
24
- "license": "MIT",
25
- "dependencies": {
26
- "file-uri-to-path": "1.0.0"
27
- }
28
- }