@gscdump/engine-sqlite 0.20.2 → 0.21.0

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 (2) hide show
  1. package/dist/index.mjs +14 -6
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -133,11 +133,19 @@ const schema = {
133
133
  ...metricCols()
134
134
  })
135
135
  };
136
- const GSC_PREFIX_RE = /^gsc_/;
136
+ const GSC_TABLE_TO_LOGICAL = {
137
+ gsc_pages: "pages",
138
+ gsc_keywords: "queries",
139
+ gsc_countries: "countries",
140
+ gsc_devices: null,
141
+ gsc_page_keywords: "page_queries",
142
+ gsc_search_appearance: "search_appearance",
143
+ gsc_hourly_pages: "hourly_pages"
144
+ };
137
145
  assertSchemaInSync({
138
146
  label: "sqlite",
139
- schema,
140
- tableKeyToName: (key) => key.replace(GSC_PREFIX_RE, ""),
147
+ schema: Object.fromEntries(Object.entries(schema).filter(([k]) => GSC_TABLE_TO_LOGICAL[k] !== null)),
148
+ tableKeyToName: (key) => GSC_TABLE_TO_LOGICAL[key],
141
149
  mode: "superset"
142
150
  });
143
151
  const sqliteDialect = new SQLiteAsyncDialect();
@@ -170,10 +178,10 @@ function createSqliteResolverAdapter(options = {}) {
170
178
  schema,
171
179
  datasetToTableKey: {
172
180
  pages: "gsc_pages",
173
- keywords: "gsc_keywords",
174
- page_keywords: "gsc_page_keywords",
181
+ queries: "gsc_keywords",
182
+ page_queries: "gsc_page_keywords",
175
183
  countries: "gsc_countries",
176
- devices: "gsc_devices",
184
+ dates: "gsc_devices",
177
185
  search_appearance: "gsc_search_appearance",
178
186
  hourly_pages: "gsc_hourly_pages"
179
187
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/engine-sqlite",
3
3
  "type": "module",
4
- "version": "0.20.2",
4
+ "version": "0.21.0",
5
5
  "description": "SQLite / D1 engine adapter for @gscdump/analysis — typed analytics over sqlite-proxy executors (Cloudflare D1, libsql).",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -44,8 +44,8 @@
44
44
  "drizzle-orm": "^0.45.2"
45
45
  },
46
46
  "dependencies": {
47
- "gscdump": "0.20.2",
48
- "@gscdump/engine": "0.20.2"
47
+ "@gscdump/engine": "0.21.0",
48
+ "gscdump": "0.21.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "drizzle-orm": "^0.45.2",