mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-05-24 10:29:11 +00:00
Add mariadb specific types (#425)
This commit is contained in:
parent
1cc974ee1c
commit
f46a6b2ee9
@ -26,7 +26,7 @@ import { isRtl } from "../i18n/utils/rtl";
|
|||||||
import { useSearchParams } from "react-router-dom";
|
import { useSearchParams } from "react-router-dom";
|
||||||
import { get } from "../api/gists";
|
import { get } from "../api/gists";
|
||||||
|
|
||||||
export const IdContext = createContext({ gistId: "" });
|
export const IdContext = createContext({ gistId: "", setGistId: () => {} });
|
||||||
|
|
||||||
export default function WorkSpace() {
|
export default function WorkSpace() {
|
||||||
const [id, setId] = useState(0);
|
const [id, setId] = useState(0);
|
||||||
|
@ -2017,13 +2017,47 @@ export const oraclesqlTypes = new Proxy(oraclesqlTypesBase, {
|
|||||||
get: (target, prop) => (prop in target ? target[prop] : false),
|
get: (target, prop) => (prop in target ? target[prop] : false),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const mariadbTypesBase = {
|
||||||
|
UUID: {
|
||||||
|
type: "UUID",
|
||||||
|
checkDefault: (field) => true,
|
||||||
|
isSized: false,
|
||||||
|
hasCheck: true,
|
||||||
|
hasPrecision: false,
|
||||||
|
noDefault: false,
|
||||||
|
},
|
||||||
|
INET4: {
|
||||||
|
type: "INET4",
|
||||||
|
checkDefault: (field) => true,
|
||||||
|
isSized: false,
|
||||||
|
hasCheck: true,
|
||||||
|
hasPrecision: false,
|
||||||
|
noDefault: false,
|
||||||
|
},
|
||||||
|
INET6: {
|
||||||
|
type: "INET6",
|
||||||
|
checkDefault: (field) => true,
|
||||||
|
isSized: false,
|
||||||
|
hasCheck: true,
|
||||||
|
hasPrecision: false,
|
||||||
|
noDefault: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const mariadbTypes = new Proxy(
|
||||||
|
{ ...mysqlTypes, ...mariadbTypesBase },
|
||||||
|
{
|
||||||
|
get: (target, prop) => (prop in target ? target[prop] : false),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const dbToTypesBase = {
|
const dbToTypesBase = {
|
||||||
[DB.GENERIC]: defaultTypes,
|
[DB.GENERIC]: defaultTypes,
|
||||||
[DB.MYSQL]: mysqlTypes,
|
[DB.MYSQL]: mysqlTypes,
|
||||||
[DB.POSTGRES]: postgresTypes,
|
[DB.POSTGRES]: postgresTypes,
|
||||||
[DB.SQLITE]: sqliteTypes,
|
[DB.SQLITE]: sqliteTypes,
|
||||||
[DB.MSSQL]: mssqlTypes,
|
[DB.MSSQL]: mssqlTypes,
|
||||||
[DB.MARIADB]: mysqlTypes,
|
[DB.MARIADB]: mariadbTypes,
|
||||||
[DB.ORACLESQL]: oraclesqlTypes,
|
[DB.ORACLESQL]: oraclesqlTypes,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user