Skip to content

Commit

Permalink
fix: bigint support, closes #197
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Feb 26, 2022
1 parent ddee68b commit b703955
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/FakerMethods.js
Expand Up @@ -134,7 +134,7 @@ export default class {
{ name: 'phoneNumberFormat', group: 'phone', types: ['string'] },
{ name: 'phoneFormats', group: 'phone', types: ['string'] },

{ name: 'number', group: 'datatype', types: ['string', 'number'], params: ['min', 'max'] },
{ name: 'number', group: 'random', types: ['string', 'number'], params: ['min', 'max'] },
{ name: 'float', group: 'random', types: ['string', 'float'], params: ['min', 'max'] },
{ name: 'arrayElement', group: 'random', types: ['string'] },
{ name: 'arrayElements', group: 'random', types: ['string'] },
Expand Down
4 changes: 3 additions & 1 deletion src/main/libs/clients/MySQLClient.js
Expand Up @@ -114,7 +114,9 @@ export class MySQLClient extends AntaresCore {
port: this._params.port,
user: this._params.user,
password: this._params.password,
ssl: null
ssl: null,
supportBigNumbers: true,
bigNumberStrings: true
};

if (this._params.schema?.length) dbConfig.database = this._params.schema;
Expand Down
1 change: 0 additions & 1 deletion src/main/libs/clients/PostgreSQLClient.js
Expand Up @@ -9,7 +9,6 @@ function pgToString (value) {
return value.toString();
}

types.setTypeParser(20, a => parseInt(a));// bigint string to number
types.setTypeParser(1082, pgToString); // date
types.setTypeParser(1083, pgToString); // time
types.setTypeParser(1114, pgToString); // timestamp
Expand Down
2 changes: 1 addition & 1 deletion src/main/libs/clients/SQLiteClient.js
Expand Up @@ -163,7 +163,7 @@ export class SQLiteClient extends AntaresCore {
nullable: !field.notnull,
unsigned: null,
zerofill: null,
order: field.cid + 1,
order: typeof field.cid === 'string' ? +field.cid + 1 : field.cid + 1,
default: field.dflt_value,
charset: null,
collation: null,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ForeignKeySelect.vue
Expand Up @@ -7,7 +7,7 @@
@blur="$emit('blur')"
>
<option v-if="!isValidDefault" :value="value">
{{ value }} - {{ $t('message.invalidDefault') }}
{{ value === null ? 'NULL' : value }}
</option>
<option
v-for="row in foreignList"
Expand Down

0 comments on commit b703955

Please sign in to comment.