@remix-run/data-table-mysql 0.3.1 → 0.5.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.
@@ -1,5 +1,6 @@
1
1
  import { getTableName, getTablePrimaryKey } from '@remix-run/data-table'
2
- import type { DataManipulationOperation, Predicate, SqlStatement } from '@remix-run/data-table'
2
+ import type { Predicate, SqlStatement } from '@remix-run/data-table'
3
+ import type { DataManipulationOperation } from '@remix-run/data-table'
3
4
  import {
4
5
  collectColumns as collectColumnsHelper,
5
6
  normalizeJoinType as normalizeJoinTypeHelper,
@@ -43,8 +44,8 @@ export function compileMysqlOperation(operation: DataManipulationOperation): Sql
43
44
  compileGroupByClause(operation.groupBy) +
44
45
  compileHavingClause(operation.having, context) +
45
46
  compileOrderByClause(operation.orderBy) +
46
- compileLimitClause(operation.limit) +
47
- compileOffsetClause(operation.offset),
47
+ compileLimitClause(operation.limit, context) +
48
+ compileOffsetClause(operation.offset, context),
48
49
  values: context.values,
49
50
  }
50
51
  }
@@ -279,20 +280,20 @@ function compileOrderByClause(orderBy: { column: string; direction: 'asc' | 'des
279
280
  )
280
281
  }
281
282
 
282
- function compileLimitClause(limit: number | undefined): string {
283
+ function compileLimitClause(limit: number | undefined, context: CompileContext): string {
283
284
  if (limit === undefined) {
284
285
  return ''
285
286
  }
286
287
 
287
- return ' limit ' + String(limit)
288
+ return ' limit ' + pushValue(context, limit)
288
289
  }
289
290
 
290
- function compileOffsetClause(offset: number | undefined): string {
291
+ function compileOffsetClause(offset: number | undefined, context: CompileContext): string {
291
292
  if (offset === undefined) {
292
293
  return ''
293
294
  }
294
295
 
295
- return ' offset ' + String(offset)
296
+ return ' offset ' + pushValue(context, offset)
296
297
  }
297
298
 
298
299
  function compilePredicate(predicate: Predicate, context: CompileContext): string {
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/lib/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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