mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 13:46:00 +00:00
tabl eoptions for mysql - comment, engine
This commit is contained in:
@@ -132,6 +132,30 @@ const mysqlDriverBase = {
|
||||
{ label: 'New function', sql: 'CREATE FUNCTION myfunc (arg1 INT)\nRETURNS INT DETERMINISTIC\nRETURN 1' },
|
||||
];
|
||||
},
|
||||
|
||||
getSupportedEngines() {
|
||||
return [];
|
||||
},
|
||||
|
||||
getTableFormOptions(intent) {
|
||||
const isNewTable = intent == 'newTableForm';
|
||||
return [
|
||||
{
|
||||
type: isNewTable ? 'dropdowntext' : 'text',
|
||||
options: this.getSupportedEngines(),
|
||||
label: 'Engine',
|
||||
name: 'tableEngine',
|
||||
sqlFormatString: '^engine = %s',
|
||||
disabled: !isNewTable,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Comment',
|
||||
name: 'objectComment',
|
||||
sqlFormatString: '^comment %v',
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
/** @type {import('dbgate-types').EngineDriver} */
|
||||
@@ -142,6 +166,27 @@ const mysqlDriver = {
|
||||
__analyserInternals: {
|
||||
quoteDefaultValues: true,
|
||||
},
|
||||
|
||||
getSupportedEngines() {
|
||||
const mysqlEngines = [
|
||||
'InnoDB', // Default and most commonly used engine with ACID transaction support and referential integrity.
|
||||
'MyISAM', // Older engine without transaction or referential integrity support.
|
||||
'MEMORY', // Tables stored in memory, very fast but volatile, used for temporary data.
|
||||
'CSV', // Tables stored in CSV format, useful for import/export of data.
|
||||
'ARCHIVE', // Engine for storing large amounts of historical data with compression.
|
||||
'BLACKHOLE', // Engine that discards data, useful for replication.
|
||||
'FEDERATED', // Access tables on remote MySQL servers.
|
||||
'MRG_MYISAM', // Merges multiple MyISAM tables into one.
|
||||
'NDB', // Cluster storage engine for MySQL Cluster.
|
||||
'EXAMPLE', // Example engine for developers, has no real functionality.
|
||||
'PERFORMANCE_SCHEMA', // Engine used for performance monitoring in MySQL.
|
||||
'SEQUENCE', // Special engine for sequences, used in MariaDB.
|
||||
'SPIDER', // Engine for horizontal partitioning, often used in MariaDB.
|
||||
'ROCKSDB', // Engine optimized for read-heavy workloads, commonly used in Facebook MySQL.
|
||||
'TokuDB', // Engine with high data compression and SSD optimization.
|
||||
];
|
||||
return mysqlEngines;
|
||||
},
|
||||
};
|
||||
|
||||
/** @type {import('dbgate-types').EngineDriver} */
|
||||
@@ -152,6 +197,31 @@ const mariaDriver = {
|
||||
__analyserInternals: {
|
||||
quoteDefaultValues: false,
|
||||
},
|
||||
getSupportedEngines() {
|
||||
const mariaDBEngines = [
|
||||
'InnoDB', // Main transactional engine, similar to MySQL, supports ACID transactions and referential integrity.
|
||||
'Aria', // Replacement for MyISAM, supports crash recovery and optimized for high speed.
|
||||
'MyISAM', // Older engine without transaction support, still supported for compatibility.
|
||||
'MEMORY', // Tables stored in memory, suitable for temporary data.
|
||||
'CSV', // Stores data in CSV format, easy for export/import.
|
||||
'ARCHIVE', // Stores compressed data, suitable for historical records.
|
||||
'BLACKHOLE', // Engine that does not store data, often used for replication.
|
||||
'FEDERATED', // Allows access to tables on remote MariaDB/MySQL servers.
|
||||
'MRG_MyISAM', // Allows merging multiple MyISAM tables into one.
|
||||
'SEQUENCE', // Special engine for generating sequences.
|
||||
'SphinxSE', // Engine for full-text search using Sphinx.
|
||||
'SPIDER', // Engine for sharding, supports horizontal partitioning.
|
||||
'TokuDB', // High-compression engine optimized for large data sets and SSDs.
|
||||
'RocksDB', // Read-optimized engine focused on performance with large data.
|
||||
'CONNECT', // Engine for accessing external data sources (e.g., files, web services).
|
||||
'OQGRAPH', // Graph engine, suitable for hierarchical and graph structures.
|
||||
'ColumnStore', // Analytical engine for columnar data storage, suitable for Big Data.
|
||||
'Mroonga', // Engine supporting full-text search in Japanese and other languages.
|
||||
'S3', // Allows storing data in Amazon S3-compatible storage.
|
||||
'XtraDB', // Enhanced InnoDB engine with optimizations from Percona (commonly used in older MariaDB versions).
|
||||
];
|
||||
return mariaDBEngines;
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = [mysqlDriver, mariaDriver];
|
||||
|
||||
Reference in New Issue
Block a user