Skip to content

feat: add mysql driver #74

feat: add mysql driver

feat: add mysql driver #74

GitHub Actions / Tests annotations (🧪 jest-coverage-report-action) failed Sep 3, 2024 in 0s

Test suite run failed

Failed tests: 2/55. Failed suites: 1/6.

Details

Created failed tests' annotations. To disable them, see documentation.

  ● parse column constraint

    expect(received).toEqual(expected) // deep equality

    - Expected  - 0
    + Received  + 1

    @@ -4,8 +4,9 @@
            "user_id",
          ],
          "foreignColumns": Array [
            "id",
          ],
    +     "foreignSchemaName": "main",
          "foreignTableName": "users",
        },
      }

      78 |   expect(
      79 |     pcc(`foreign key ("user_id") references "users" on delete cascade ("id")`)
    > 80 |   ).toEqual({
         |     ^
      81 |     foreignKey: {
      82 |       columns: ["user_id"],
      83 |       foreignTableName: "users",

      at Object.toEqual (src/drivers/sqlite/sql-parse-table.test.ts:80:5)

  ● parse create table with table constraints

    expect(received).toEqual(expected) // deep equality

    - Expected  - 0
    + Received  + 8

    @@ -1,20 +1,24 @@
      Object {
        "autoIncrement": false,
        "columns": Array [
          Object {
    +       "constraint": undefined,
            "name": "first_name",
            "pk": true,
            "type": "varchar",
          },
          Object {
    +       "constraint": undefined,
            "name": "last_name",
            "pk": true,
            "type": "varchar",
          },
          Object {
    +       "constraint": undefined,
            "name": "category_id",
    +       "pk": undefined,
            "type": "integer",
          },
        ],
        "constraints": Array [
          Object {
    @@ -22,23 +26,27 @@
            "primaryColumns": Array [
              "first_name",
              "last_name",
            ],
            "primaryKey": true,
    +       "primaryKeyConflict": undefined,
    +       "primaryKeyOrder": undefined,
          },
          Object {
            "foreignKey": Object {
              "columns": Array [
                "category_id",
              ],
              "foreignColumns": Array [
                "id",
              ],
    +         "foreignSchemaName": "main",
              "foreignTableName": "category",
            },
          },
        ],
    +   "fts5": undefined,
        "pk": Array [
          "first_name",
          "last_name",
        ],
        "schemaName": "main",

      171 |   );`;
      172 |
    > 173 |   expect(p(sql)).toEqual({
          |                  ^
      174 |     tableName: "users",
      175 |     schemaName: "main",
      176 |     pk: ["first_name", "last_name"],

      at Object.toEqual (src/drivers/sqlite/sql-parse-table.test.ts:173:18)

Annotations

Check failure on line 20 in src/drivers/sqlite/sql-parse-table.test.ts

See this annotation in the file changed.

@github-actions github-actions / Tests annotations (🧪 jest-coverage-report-action)

parse column constraint

Error: expect(received).toEqual(expected) // deep equality

- Expected  - 0
+ Received  + 1

@@ -4,8 +4,9 @@
        "user_id",
      ],
      "foreignColumns": Array [
        "id",
      ],
+     "foreignSchemaName": "main",
      "foreignTableName": "users",
    },
  }
    at Object.toEqual (/home/runner/work/libsql-studio/libsql-studio/src/drivers/sqlite/sql-parse-table.test.ts:80:5)
    at Promise.then.completed (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:126:9)
    at run (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 164 in src/drivers/sqlite/sql-parse-table.test.ts

See this annotation in the file changed.

@github-actions github-actions / Tests annotations (🧪 jest-coverage-report-action)

parse create table with table constraints

Error: expect(received).toEqual(expected) // deep equality

- Expected  - 0
+ Received  + 8

@@ -1,20 +1,24 @@
  Object {
    "autoIncrement": false,
    "columns": Array [
      Object {
+       "constraint": undefined,
        "name": "first_name",
        "pk": true,
        "type": "varchar",
      },
      Object {
+       "constraint": undefined,
        "name": "last_name",
        "pk": true,
        "type": "varchar",
      },
      Object {
+       "constraint": undefined,
        "name": "category_id",
+       "pk": undefined,
        "type": "integer",
      },
    ],
    "constraints": Array [
      Object {
@@ -22,23 +26,27 @@
        "primaryColumns": Array [
          "first_name",
          "last_name",
        ],
        "primaryKey": true,
+       "primaryKeyConflict": undefined,
+       "primaryKeyOrder": undefined,
      },
      Object {
        "foreignKey": Object {
          "columns": Array [
            "category_id",
          ],
          "foreignColumns": Array [
            "id",
          ],
+         "foreignSchemaName": "main",
          "foreignTableName": "category",
        },
      },
    ],
+   "fts5": undefined,
    "pk": Array [
      "first_name",
      "last_name",
    ],
    "schemaName": "main",
    at Object.toEqual (/home/runner/work/libsql-studio/libsql-studio/src/drivers/sqlite/sql-parse-table.test.ts:173:18)
    at Promise.then.completed (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:126:9)
    at run (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/libsql-studio/libsql-studio/node_modules/jest-runner/build/testWorker.js:106:12)