@lunora/sql-store 1.0.0-alpha.16 → 1.0.0-alpha.18

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.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { createSqlCtxDb, decodeGlobalRow, readSqlCdcChanges, runSqlAggregateMigrations, runSqlCdcMigration, runSqlGlobalTableMigrations, runSqlRankMigrations, runSqlSearchMigrations, trimSqlCdcChanges } from './packem_shared/createSqlCtxDb-BlGq23Wp.mjs';
1
+ export { createSqlCtxDb, decodeGlobalRow, readSqlCdcChanges, runSqlAggregateMigrations, runSqlCdcMigration, runSqlGlobalTableMigrations, runSqlRankMigrations, runSqlSearchMigrations, trimSqlCdcChanges } from './packem_shared/createSqlCtxDb-KeafmDIp.mjs';
2
2
  export { decodeBigint, effectiveColumnKind, sqliteDecode, sqliteEncode, tryJsonParse } from './packem_shared/decodeBigint-Dedu92k4.mjs';
@@ -568,7 +568,12 @@ const createSqlCtxDb = (options) => {
568
568
  fieldRef: columnRefSql,
569
569
  serialize: serializeColumnValue,
570
570
  // MySQL has no `||` string concat; the rest use the portable form compileWhereSql defaults to.
571
- ...dialect.name === "mysql" ? { likeContains: (reference, term) => sql`${reference} LIKE CONCAT('%', ${term}, '%')` } : {}
571
+ // The term is wildcard-escaped by compileContains, so pair it with a backslash `ESCAPE` for literal
572
+ // matching. MySQL treats backslash as a string-literal escape, so the SQL text must contain a DOUBLED
573
+ // backslash (`ESCAPE '\\'`) to denote one literal backslash; drizzle's `sql` tag uses the COOKED
574
+ // template string, so `'\\\\'` here renders `'\\'` in the SQL (a single `'\'` would escape the closing
575
+ // quote and raise a syntax error). SQLite/Postgres take backslash literally and use the portable default.
576
+ ...dialect.name === "mysql" ? { likeContains: (reference, term) => sql`${reference} LIKE CONCAT('%', ${term}, '%') ESCAPE '\\\\'` } : {}
572
577
  };
573
578
  const nullSafeEquals = (reference, value) => nullSafeEqualsSql(dialect.name, reference, value);
574
579
  const upsertSql = (config) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/sql-store",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.18",
4
4
  "description": "Internal dialect-parameterized SQL store core for Lunora .global() backends (D1, PlanetScale)",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -50,7 +50,7 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@lunora/do": "1.0.0-alpha.16",
53
+ "@lunora/do": "1.0.0-alpha.18",
54
54
  "drizzle-orm": "^0.45.2"
55
55
  },
56
56
  "engines": {