kysely-kit
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -11,3 +11,4 @@ import camelcase from 'camelcase'; | ||
const name = camelcase(column.name); | ||
let type = mapDataType(column.dataType); | ||
const isArray = column.dataType.startsWith('_'); | ||
let type = mapDataType(isArray ? column.dataType.slice(1) : column.dataType); | ||
if (name === 'createdAt' && type === 'Date' && column.hasDefaultValue) { | ||
@@ -20,2 +21,5 @@ type = 'GeneratedAlways<Date>'; | ||
else { | ||
if (isArray) { | ||
type = `${type}[]`; | ||
} | ||
if (column.isAutoIncrementing) { | ||
@@ -22,0 +26,0 @@ type = `GeneratedAlways<${type}>`; |
@@ -7,2 +7,3 @@ export default function mapDataType(dataType) { | ||
return 'JSONColumnType<{}>'; | ||
case 'text': | ||
case 'varchar': | ||
@@ -9,0 +10,0 @@ return 'string'; |
{ | ||
"name": "kysely-kit", | ||
"description": "Useful utilities for working with Kysely", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"author": "Vlad Shcherbin <vlad.shcherbin@gmail.com>", | ||
@@ -6,0 +6,0 @@ "repository": "vladshcherbin/kysely-kit", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9948
236