fix: bigint support, closes #197

This commit is contained in:
Fabio Di Stasio 2022-02-26 10:02:23 +01:00
parent ddee68b4c2
commit b7039553cc
5 changed files with 6 additions and 5 deletions

View File

@ -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'] },

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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"