1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: support of bit fields in table filler

This commit is contained in:
2021-02-18 15:26:17 +01:00
parent 014257147e
commit 94c4952319
3 changed files with 8 additions and 1 deletions

View File

@ -232,6 +232,8 @@ export default (connections) => {
else else
escapedParam = '""'; escapedParam = '""';
} }
else if (BIT.includes(type))
escapedParam = `b'${sqlEscaper(params.row[key].value)}'`;
else else
escapedParam = `"${sqlEscaper(params.row[key].value)}"`; escapedParam = `"${sqlEscaper(params.row[key].value)}"`;

View File

@ -136,6 +136,8 @@ export default {
this.localType = 'datetime'; this.localType = 'datetime';
else if (TIME.includes(this.type)) else if (TIME.includes(this.type))
this.localType = 'time'; this.localType = 'time';
else
this.localType = 'none';
return FakerMethods.getGroupsByType(this.localType); return FakerMethods.getGroupsByType(this.localType);
}, },

View File

@ -184,7 +184,7 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import { TEXT, LONG_TEXT, NUMBER, FLOAT, DATE, TIME, DATETIME, BLOB } from 'common/fieldTypes'; import { TEXT, LONG_TEXT, NUMBER, FLOAT, DATE, TIME, DATETIME, BLOB, BIT } from 'common/fieldTypes';
import { mask } from 'vue-the-mask'; import { mask } from 'vue-the-mask';
import { mapGetters, mapActions } from 'vuex'; import { mapGetters, mapActions } from 'vuex';
import Tables from '@/ipc-api/Tables'; import Tables from '@/ipc-api/Tables';
@ -262,6 +262,9 @@ export default {
if ([...TIME, ...DATE].includes(field.type)) if ([...TIME, ...DATE].includes(field.type))
fieldDefault = field.default; fieldDefault = field.default;
if (BIT.includes(field.type))
fieldDefault = field.default.replaceAll('\'', '').replaceAll('b', '');
if (DATETIME.includes(field.type)) { if (DATETIME.includes(field.type)) {
if (field.default && field.default.toLowerCase().includes('current_timestamp')) { if (field.default && field.default.toLowerCase().includes('current_timestamp')) {
let datePrecision = ''; let datePrecision = '';