Skip to content

Commit f46a6b2

Browse files
authored
Add mariadb specific types (#425)
1 parent 1cc974e commit f46a6b2

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

src/components/Workspace.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { isRtl } from "../i18n/utils/rtl";
2626
import { useSearchParams } from "react-router-dom";
2727
import { get } from "../api/gists";
2828

29-
export const IdContext = createContext({ gistId: "" });
29+
export const IdContext = createContext({ gistId: "", setGistId: () => {} });
3030

3131
export default function WorkSpace() {
3232
const [id, setId] = useState(0);

src/data/datatypes.js

+35-1
Original file line numberDiff line numberDiff line change
@@ -2017,13 +2017,47 @@ export const oraclesqlTypes = new Proxy(oraclesqlTypesBase, {
20172017
get: (target, prop) => (prop in target ? target[prop] : false),
20182018
});
20192019

2020+
export const mariadbTypesBase = {
2021+
UUID: {
2022+
type: "UUID",
2023+
checkDefault: (field) => true,
2024+
isSized: false,
2025+
hasCheck: true,
2026+
hasPrecision: false,
2027+
noDefault: false,
2028+
},
2029+
INET4: {
2030+
type: "INET4",
2031+
checkDefault: (field) => true,
2032+
isSized: false,
2033+
hasCheck: true,
2034+
hasPrecision: false,
2035+
noDefault: false,
2036+
},
2037+
INET6: {
2038+
type: "INET6",
2039+
checkDefault: (field) => true,
2040+
isSized: false,
2041+
hasCheck: true,
2042+
hasPrecision: false,
2043+
noDefault: false,
2044+
},
2045+
};
2046+
2047+
export const mariadbTypes = new Proxy(
2048+
{ ...mysqlTypes, ...mariadbTypesBase },
2049+
{
2050+
get: (target, prop) => (prop in target ? target[prop] : false),
2051+
},
2052+
);
2053+
20202054
const dbToTypesBase = {
20212055
[DB.GENERIC]: defaultTypes,
20222056
[DB.MYSQL]: mysqlTypes,
20232057
[DB.POSTGRES]: postgresTypes,
20242058
[DB.SQLITE]: sqliteTypes,
20252059
[DB.MSSQL]: mssqlTypes,
2026-
[DB.MARIADB]: mysqlTypes,
2060+
[DB.MARIADB]: mariadbTypes,
20272061
[DB.ORACLESQL]: oraclesqlTypes,
20282062
};
20292063

0 commit comments

Comments
 (0)