Skip to content

Commit

Permalink
improve type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
thrownullexception committed Jun 3, 2024
1 parent a81d2e5 commit f91e0a8
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 33 deletions.
37 changes: 17 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"eslint.validate": [
"typescript",
"typescriptreact",
],
"prettier.eslintIntegration": true,
}
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"eslint.validate": ["typescript", "typescriptreact"],
"prettier.eslintIntegration": true
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashpress/bacteria",
"version": "0.0.13",
"version": "0.0.14",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/MssqlDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default class MssqlDriver extends AbstractDriver {
let tscType = "";
switch (resp.DATA_TYPE) {
case "bigint":
tscType = "string";
tscType = "number";
break;
case "bit":
tscType = "boolean";
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/MysqlDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class MysqlDriver extends AbstractDriver {
tscType = "number";
break;
case "bigint":
tscType = "string";
tscType = "number";
break;
case "float":
tscType = "number";
Expand Down
10 changes: 5 additions & 5 deletions src/drivers/PostgresDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default class PostgresDriver extends AbstractDriver {
ret.tsType = "number";
break;
case "int8":
ret.tsType = "string";
ret.tsType = "number";
break;
case "smallint":
ret.tsType = "number";
Expand All @@ -213,13 +213,13 @@ export default class PostgresDriver extends AbstractDriver {
ret.tsType = "number";
break;
case "bigint":
ret.tsType = "string";
ret.tsType = "number";
break;
case "decimal":
ret.tsType = "string";
ret.tsType = "number";
break;
case "numeric":
ret.tsType = "string";
ret.tsType = "number";
break;
case "real":
ret.tsType = "number";
Expand All @@ -237,7 +237,7 @@ export default class PostgresDriver extends AbstractDriver {
ret.tsType = "number";
break;
case "money":
ret.tsType = "string";
ret.tsType = "number";
break;
case "character varying":
ret.tsType = "string";
Expand Down
6 changes: 3 additions & 3 deletions src/drivers/SqliteDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ export default class SqliteDriver extends AbstractDriver {
tscType = "number";
break;
case "bigint":
tscType = "string";
tscType = "number";
break;
case "unsigned big int":
tscType = "string";
tscType = "number";
break;
case "character":
tscType = "string";
Expand Down Expand Up @@ -149,7 +149,7 @@ export default class SqliteDriver extends AbstractDriver {
tscType = "boolean";
break;
case "date":
tscType = "string";
tscType = "Date";
break;
case "datetime":
tscType = "Date";
Expand Down

0 comments on commit f91e0a8

Please sign in to comment.