Initial commit

This commit is contained in:
2026-08-30 15:23:57 +02:00
commit dab5679098
1293 changed files with 240952 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2015-2025 MariaDB Corporation Ab
/**
* Capabilities list (with 'CLIENT_' removed)
* see: https://mariadb.com/kb/en/library/1-connecting-connecting/#capabilities
*/
/* mysql/old mariadb server/client */
export const MYSQL = 1n;
/* Found instead of affected rows */
export const FOUND_ROWS = 2n;
/* get all column flags */
export const LONG_FLAG = 4n;
/* one can specify db on connecting */
export const CONNECT_WITH_DB = 8n;
/* don't allow database.table.column */
export const NO_SCHEMA = 1n << 4n;
/* can use compression protocol */
export const COMPRESS = 1n << 5n;
/* odbc client */
export const ODBC = 1n << 6n;
/* can use LOAD DATA LOCAL */
export const LOCAL_FILES = 1n << 7n;
/* ignore spaces before '' */
export const IGNORE_SPACE = 1n << 8n;
/* new 4.1 protocol */
export const PROTOCOL_41 = 1n << 9n;
/* this is an interactive client */
export const INTERACTIVE = 1n << 10n;
/* switch to ssl after the handshake */
export const SSL = 1n << 11n;
/* IGNORE sigpipes */
export const IGNORE_SIGPIPE = 1n << 12n;
/* client knows about transactions */
export const TRANSACTIONS = 1n << 13n;
/* old flag for 4.1 protocol */
export const RESERVED = 1n << 14n;
/* new 4.1 authentication */
export const SECURE_CONNECTION = 1n << 15n;
/* enable/disable multi-stmt support */
export const MULTI_STATEMENTS = 1n << 16n;
/* enable/disable multi-results */
export const MULTI_RESULTS = 1n << 17n;
/* multi-results in ps-protocol */
export const PS_MULTI_RESULTS = 1n << 18n;
/* client supports plugin authentication */
export const PLUGIN_AUTH = 1n << 19n;
/* permits connection attributes */
export const CONNECT_ATTRS = 1n << 20n;
/* Enable an authentication response packet to be larger than 255 bytes. */
export const PLUGIN_AUTH_LENENC_CLIENT_DATA = 1n << 21n;
/* Don't close the connection for a connection with an expired password. */
export const CAN_HANDLE_EXPIRED_PASSWORDS = 1n << 22n;
/* Capable of handling server state change information. It's a hint to the
server to include the state change information in Ok packet. */
export const SESSION_TRACK = 1n << 23n;
/* Client no longer needs EOF packet */
export const DEPRECATE_EOF = 1n << 24n;
export const SSL_VERIFY_SERVER_CERT = 1n << 30n;
/* MariaDB extended capabilities */
/* Permit bulk insert*/
export const MARIADB_CLIENT_STMT_BULK_OPERATIONS = 1n << 34n;
/* Clients supporting extended metadata */
export const MARIADB_CLIENT_EXTENDED_METADATA = 1n << 35n;
/* permit metadata caching */
export const MARIADB_CLIENT_CACHE_METADATA = 1n << 36n;
/* permit returning all bulk individual results */
export const BULK_UNIT_RESULTS = 1n << 37n;
+1441
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2015-2025 MariaDB Corporation Ab
'use strict';
export const NOT_CONNECTED = 1;
export const CONNECTING = 2;
export const AUTHENTICATING = 3;
export const INIT_CMD = 4;
export const CONNECTED = 5;
export const TERMINATING = 6;
export const TERMINATING_SOCKET = 7;
export const CLOSED = 8;
+1445
View File
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2015-2025 MariaDB Corporation Ab
/**
* Column definition packet "Field detail" flag value
* see : https://mariadb.com/kb/en/library/resultset/#field-detail-flag
*/
// field cannot be null
export const NOT_NULL = 1;
// field is a primary key
export const PRIMARY_KEY = 2;
//field is unique
export const UNIQUE_KEY = 4;
//field is in a multiple key
export const MULTIPLE_KEY = 8;
//is this field a Blob?
export const BLOB = 1 << 4;
//is this field unsigned?
export const UNSIGNED = 1 << 5;
//is this field a zerofill?
export const ZEROFILL_FLAG = 1 << 6;
//whether this field has a binary collation
export const BINARY_COLLATION = 1 << 7;
//Field is an enumeration
export const ENUM = 1 << 8;
//field auto-increment
export const AUTO_INCREMENT = 1 << 9;
//field is a timestamp value
export const TIMESTAMP = 1 << 10;
//field is a SET
export const SET = 1 << 11;
//field doesn't have a default value
export const NO_DEFAULT_VALUE_FLAG = 1 << 12;
//field is set to NOW on UPDATE
export const ON_UPDATE_NOW_FLAG = 1 << 13;
//field is num
export const NUM_FLAG = 1 << 14;
+74
View File
@@ -0,0 +1,74 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2015-2025 MariaDB Corporation Ab
/**
* Field types
* see https://mariadb.com/kb/en/library/resultset/#field-types
*/
export const DECIMAL = 0;
export const TINY = 1;
export const SHORT = 2;
export const INT = 3;
export const FLOAT = 4;
export const DOUBLE = 5;
export const NULL = 6;
export const TIMESTAMP = 7;
export const BIGINT = 8;
export const INT24 = 9;
export const DATE = 10;
export const TIME = 11;
export const DATETIME = 12;
export const YEAR = 13;
export const NEWDATE = 14;
export const VARCHAR = 15;
export const BIT = 16;
export const TIMESTAMP2 = 17;
export const DATETIME2 = 18;
export const TIME2 = 19;
export const JSON = 245; //only for MySQL
export const NEWDECIMAL = 246;
export const ENUM = 247;
export const SET = 248;
export const TINY_BLOB = 249;
export const MEDIUM_BLOB = 250;
export const LONG_BLOB = 251;
export const BLOB = 252;
export const VAR_STRING = 253;
export const STRING = 254;
export const GEOMETRY = 255;
const typeNames = [];
typeNames[0] = 'DECIMAL';
typeNames[1] = 'TINY';
typeNames[2] = 'SHORT';
typeNames[3] = 'INT';
typeNames[4] = 'FLOAT';
typeNames[5] = 'DOUBLE';
typeNames[6] = 'NULL';
typeNames[7] = 'TIMESTAMP';
typeNames[8] = 'BIGINT';
typeNames[9] = 'INT24';
typeNames[10] = 'DATE';
typeNames[11] = 'TIME';
typeNames[12] = 'DATETIME';
typeNames[13] = 'YEAR';
typeNames[14] = 'NEWDATE';
typeNames[15] = 'VARCHAR';
typeNames[16] = 'BIT';
typeNames[17] = 'TIMESTAMP2';
typeNames[18] = 'DATETIME2';
typeNames[19] = 'TIME2';
typeNames[245] = 'JSON';
typeNames[246] = 'NEWDECIMAL';
typeNames[247] = 'ENUM';
typeNames[248] = 'SET';
typeNames[249] = 'TINY_BLOB';
typeNames[250] = 'MEDIUM_BLOB';
typeNames[251] = 'LONG_BLOB';
typeNames[252] = 'BLOB';
typeNames[253] = 'VAR_STRING';
typeNames[254] = 'STRING';
typeNames[255] = 'GEOMETRY';
export const TYPES = typeNames;
+33
View File
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2015-2025 MariaDB Corporation Ab
/**
* possible server status flag value
* see https://mariadb.com/kb/en/library/ok_packet/#server-status-flag
* @type {number}
*/
//A transaction is currently active
export const STATUS_IN_TRANS = 1;
//Autocommit mode is set
export const STATUS_AUTOCOMMIT = 2;
//more results exist (more packets follow)
export const MORE_RESULTS_EXISTS = 8;
export const QUERY_NO_GOOD_INDEX_USED = 16;
export const QUERY_NO_INDEX_USED = 32;
//when using COM_STMT_FETCH, indicate that current cursor still has result (deprecated)
export const STATUS_CURSOR_EXISTS = 64;
//when using COM_STMT_FETCH, indicate that current cursor has finished to send results (deprecated)
export const STATUS_LAST_ROW_SENT = 128;
//database has been dropped
export const STATUS_DB_DROPPED = 1 << 8;
//the current escape mode is "no backslash escape"
export const STATUS_NO_BACKSLASH_ESCAPES = 1 << 9;
//A DDL change did have an impact on an existing PREPARE (an automatic re-prepare has been executed)
export const STATUS_METADATA_CHANGED = 1 << 10;
export const QUERY_WAS_SLOW = 1 << 11;
//this result-set contains a stored procedure output parameter
export const PS_OUT_PARAMS = 1 << 12;
//the current transaction is a read-only transaction
export const STATUS_IN_TRANS_READONLY = 1 << 13;
//session state change. see a Session change type for more information
export const SESSION_STATE_CHANGED = 1 << 14;
+15
View File
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2015-2025 MariaDB Corporation Ab
/**
* Session change type.
* see: https://mariadb.com/kb/en/library/ok_packet/#session-change-type
* @type {number}
*/
export const SESSION_TRACK_SYSTEM_VARIABLES = 0;
export const SESSION_TRACK_SCHEMA = 1;
export const SESSION_TRACK_STATE_CHANGE = 2;
export const SESSION_TRACK_GTIDS = 3;
export const SESSION_TRACK_TRANSACTION_CHARACTERISTICS = 4;
export const SESSION_TRACK_TRANSACTION_STATE = 5;