Skip to content

Commit

Permalink
feat: update mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
farreldarian committed Jun 13, 2024
1 parent 08ff7fb commit d96b590
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/generator/src/lib/adapter/providers/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createModule } from '~/lib/syntaxes/module'
import { getDateMode } from '~/shared/date-mode'
import { createAdapter } from '../adapter'
import { createField, hasDefault, isDefaultFunc } from '../fields/createField'
import type { BigIntMode } from '../fields/directives/custom'

const coreModule = 'drizzle-orm/mysql-core'

Expand Down Expand Up @@ -63,7 +64,8 @@ export const mysqlAdapter = createAdapter({
return createField({
field,
imports: [namedImport(['bigint'], coreModule)],
func: `bigint('${getDbName(field)}', { mode: 'bigint' })`,
func: (opts: { mode?: BigIntMode }) =>
`bigint('${getDbName(field)}', { mode: '${opts?.mode ?? 'bigint'}' })`,
onDefault(field) {
if (
field.isId &&
Expand Down

0 comments on commit d96b590

Please sign in to comment.