@easy-cms/db-sqlite 0.6.0 → 0.7.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.js +7 -0
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -25,6 +25,13 @@ var sqliteDialect = {
25
25
  json: (name) => text(name, { mode: "json" }),
26
26
  // LIKE is case-insensitive for ASCII in SQLite.
27
27
  like: (column, pattern) => sql`${column} LIKE ${pattern} ESCAPE '\\'`,
28
+ someElement: (column, condition) => {
29
+ const where = condition((path) => {
30
+ const json = `$${path.map((p) => `."${p}"`).join("")}`;
31
+ return sql`json_extract(_el.value, ${json})`;
32
+ });
33
+ return sql`exists (select 1 from json_each(${column}) as _el${where ? sql` where ${where}` : sql``})`;
34
+ },
28
35
  param: () => "?",
29
36
  migrationsTableSQL: (name) => `CREATE TABLE IF NOT EXISTS \`${name}\` (
30
37
  \`id\` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/db-sqlite",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "SQLite / libSQL database adapter for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,14 +22,14 @@
22
22
  "@libsql/client": "^0.18.0",
23
23
  "drizzle-kit": "0.31.11",
24
24
  "drizzle-orm": "0.45.3",
25
- "@easy-cms/drizzle": "^0.6.0"
25
+ "@easy-cms/drizzle": "^0.7.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "@easy-cms/core": "^0.6.0"
28
+ "@easy-cms/core": "^0.7.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "sharp": "^0.35.4",
32
- "@easy-cms/core": "^0.6.0"
32
+ "@easy-cms/core": "^0.7.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"