mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-02-12 02:00:40 +08:00
Import SQLite source
This commit is contained in:
@@ -366,8 +366,8 @@ export const postgresTypes = {
|
||||
};
|
||||
|
||||
export const sqliteTypes = {
|
||||
INT: {
|
||||
type: "INT",
|
||||
INTEGER: {
|
||||
type: "INTEGER",
|
||||
checkDefault: (field) => {
|
||||
return intRegex.test(field.default);
|
||||
},
|
||||
@@ -386,23 +386,6 @@ export const sqliteTypes = {
|
||||
hasPrecision: true,
|
||||
defaultSize: null,
|
||||
},
|
||||
TEXT: {
|
||||
type: "TEXT",
|
||||
checkDefault: (field) => false,
|
||||
hasCheck: false,
|
||||
isSized: true,
|
||||
hasPrecision: false,
|
||||
defaultSize: 65535,
|
||||
hasQuotes: true,
|
||||
},
|
||||
BLOB: {
|
||||
type: "BLOB",
|
||||
checkDefault: (field) => false,
|
||||
isSized: false,
|
||||
hasCheck: false,
|
||||
hasPrecision: false,
|
||||
defaultSize: null,
|
||||
},
|
||||
NUMERIC: {
|
||||
type: "NUMERIC",
|
||||
checkDefault: (field) => {
|
||||
@@ -426,6 +409,42 @@ export const sqliteTypes = {
|
||||
hasPrecision: false,
|
||||
defaultSize: null,
|
||||
},
|
||||
VARCHAR: {
|
||||
type: "VARCHAR",
|
||||
checkDefault: (field) => {
|
||||
if (strHasQuotes(field.default)) {
|
||||
return field.default.length - 2 <= field.size;
|
||||
}
|
||||
return field.default.length <= field.size;
|
||||
},
|
||||
hasCheck: true,
|
||||
isSized: true,
|
||||
hasPrecision: false,
|
||||
defaultSize: 255,
|
||||
hasQuotes: true,
|
||||
},
|
||||
TEXT: {
|
||||
type: "TEXT",
|
||||
checkDefault: (field) => {
|
||||
if (strHasQuotes(field.default)) {
|
||||
return field.default.length - 2 <= field.size;
|
||||
}
|
||||
return field.default.length <= field.size;
|
||||
}, hasCheck: true,
|
||||
isSized: true,
|
||||
hasPrecision: false,
|
||||
defaultSize: 65535,
|
||||
hasQuotes: true,
|
||||
},
|
||||
BLOB: {
|
||||
type: "BLOB",
|
||||
checkDefault: (field) => false,
|
||||
isSized: false,
|
||||
hasCheck: false,
|
||||
hasPrecision: false,
|
||||
defaultSize: null,
|
||||
},
|
||||
|
||||
TIME: {
|
||||
type: "TIME",
|
||||
checkDefault: (field) => {
|
||||
|
||||
Reference in New Issue
Block a user