@deterministic-code/datasources-mysql 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MysqlBulkUpdateStatementTextRenderer.d.ts +4 -0
- package/dist/MysqlCreateTableStatementRenderer.d.ts +5 -0
- package/dist/MysqlDriver.d.ts +12 -0
- package/dist/MysqlStatementRenderer.d.ts +7 -0
- package/dist/bind.d.ts +5 -0
- package/dist/columnTypes.d.ts +1 -0
- package/dist/command.d.ts +16 -0
- package/dist/connection-options.d.ts +5 -0
- package/dist/connection.d.ts +19 -0
- package/dist/converters/BinaryConverter.d.ts +5 -0
- package/dist/converters/BoolConverter.d.ts +5 -0
- package/dist/converters/DateTimeConverter.d.ts +5 -0
- package/dist/converters/DecimalConverter.d.ts +5 -0
- package/dist/converters/MysqlRowTypeConverters.d.ts +3 -0
- package/dist/converters/UuidConverter.d.ts +5 -0
- package/dist/i-mysql-engine.d.ts +27 -0
- package/dist/index.d.ts +1 -0
- package/dist/scalar.d.ts +2 -0
- package/dist/transaction.d.ts +9 -0
- package/package.json +23 -4
- package/src/MysqlBulkUpdateStatementTextRenderer.ts +10 -0
- package/src/MysqlCreateTableStatementRenderer.ts +12 -0
- package/src/MysqlDriver.ts +54 -0
- package/src/MysqlStatementRenderer.test.ts +64 -0
- package/src/MysqlStatementRenderer.ts +34 -0
- package/src/bind.ts +31 -0
- package/src/columnTypes.ts +10 -0
- package/src/command.ts +197 -0
- package/src/connection-options.ts +6 -0
- package/src/connection.ts +91 -0
- package/src/converters/BinaryConverter.test.ts +12 -0
- package/src/converters/BinaryConverter.ts +9 -0
- package/src/converters/BoolConverter.test.ts +14 -0
- package/src/converters/BoolConverter.ts +6 -0
- package/src/converters/DateTimeConverter.test.ts +14 -0
- package/src/converters/DateTimeConverter.ts +15 -0
- package/src/converters/DecimalConverter.test.ts +11 -0
- package/src/converters/DecimalConverter.ts +7 -0
- package/src/converters/MysqlRowTypeConverters.test.ts +19 -0
- package/src/converters/MysqlRowTypeConverters.ts +25 -0
- package/src/converters/UuidConverter.test.ts +11 -0
- package/src/converters/UuidConverter.ts +6 -0
- package/src/i-mysql-engine.ts +58 -0
- package/src/index.ts +1 -0
- package/src/mysql.test.ts +342 -0
- package/src/scalar.ts +2 -0
- package/src/transaction.ts +21 -0
- package/README.md +0 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsolationLevel,
|
|
3
|
+
type ITransaction,
|
|
4
|
+
type IsolationLevelName,
|
|
5
|
+
} from "@datasources/core";
|
|
6
|
+
import type { MysqlConnection } from "./connection.ts";
|
|
7
|
+
|
|
8
|
+
export class MysqlTransaction implements ITransaction {
|
|
9
|
+
constructor(
|
|
10
|
+
readonly connection: MysqlConnection,
|
|
11
|
+
readonly isolation: IsolationLevelName = IsolationLevel.ReadCommitted,
|
|
12
|
+
) {}
|
|
13
|
+
|
|
14
|
+
async commit(): Promise<void> {
|
|
15
|
+
await this.connection.require().commit();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async abort(): Promise<void> {
|
|
19
|
+
await this.connection.require().rollback();
|
|
20
|
+
}
|
|
21
|
+
}
|
package/README.md
DELETED