Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long support? #1

Open
delaneyj opened this issue Jun 19, 2021 · 1 comment
Open

Long support? #1

delaneyj opened this issue Jun 19, 2021 · 1 comment

Comments

@delaneyj
Copy link

For the 64bit types can there be optional usage of long support instead of just string?

@koistya
Copy link
Member

koistya commented Jun 20, 2021

Yep. Would you be able to add it to this list?

knex-types/main.ts

Lines 155 to 206 in 6ad3931

switch (udt) {
case "bool":
return "boolean";
case "text":
case "citext":
case "money":
case "numeric":
case "int8":
case "char":
case "character":
case "bpchar":
case "varchar":
case "time":
case "tsquery":
case "tsvector":
case "uuid":
case "xml":
case "cidr":
case "inet":
case "macaddr":
return "string";
case "smallint":
case "integer":
case "int":
case "int4":
case "real":
case "float":
case "float4":
case "float8":
return "number";
case "date":
case "timestamp":
case "timestamptz":
return "Date";
case "json":
case "jsonb":
if (defaultValue) {
if (defaultValue.startsWith("'{")) {
return "Record<string, unknown>";
}
if (defaultValue.startsWith("'[")) {
return "unknown[]";
}
}
return "unknown";
case "bytea":
return "Buffer";
case "interval":
return "PostgresInterval";
default:
return customTypes.get(udt) ?? "unknown";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants