Skip to content

Commit b3c5fc6

Browse files
committed
Merge branch 'master' into remove-callback-layer-to-catch-sync-connection-exceptions
2 parents e2ce470 + e3391ed commit b3c5fc6

File tree

487 files changed

+50766
-62228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

487 files changed

+50766
-62228
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
website/build
2+
website/.docusaurus
3+
website/.cache-loader
4+
website/**/*.mdx

.eslintrc

+50-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"extends": ["prettier", "eslint:recommended"],
2+
"extends": ["prettier", "eslint:recommended", "plugin:markdown/recommended-legacy"],
33
"parserOptions": {
4-
"ecmaVersion": 2017
4+
"ecmaVersion": "latest"
55
},
66
"plugins": ["markdown", "async-await"],
77
"env": {
@@ -31,10 +31,56 @@
3131
"consistent-this": "error",
3232
"prefer-arrow-callback": "error",
3333
"prefer-const": "error",
34-
"arrow-parens": ["error", "as-needed"],
3534
"arrow-body-style": ["error", "as-needed"],
3635
"no-var": "error",
3736
"no-use-before-define": "error",
3837
"strict": ["error", "global"]
39-
}
38+
},
39+
"overrides": [
40+
{
41+
"files": ["**/*.ts"],
42+
"parser": "@typescript-eslint/parser",
43+
"extends": ["plugin:@typescript-eslint/recommended"],
44+
"plugins": ["@typescript-eslint"],
45+
"rules": {
46+
"@typescript-eslint/no-empty-interface": "off",
47+
"@typescript-eslint/no-explicit-any": "off",
48+
"arrow-parens": "off",
49+
"no-restricted-syntax": [
50+
"error",
51+
{
52+
"selector": "ImportDeclaration[source.value=/^\\./][source.value!=/\\.(js)$/]",
53+
"message": "Local imports must have the explicit extension"
54+
}
55+
]
56+
}
57+
},
58+
{
59+
"files": ["**/*.md/*js", "**/*.md/*ts"],
60+
"rules": {
61+
"no-undef": "off",
62+
"no-unused-vars": "off",
63+
"@typescript-eslint/no-unused-vars": "off",
64+
"no-console": "off",
65+
"no-unused-labels": "off",
66+
"strict": "off",
67+
"prefer-arrow-callback": "off"
68+
},
69+
"parserOptions": {
70+
"sourceType": "module"
71+
}
72+
},
73+
{
74+
"files": ["**/**/*.test.*"],
75+
"rules": {
76+
"arrow-parens": ["error", "always"]
77+
}
78+
},
79+
{
80+
"files": ["**/*.mjs"],
81+
"parserOptions": {
82+
"sourceType": "module"
83+
}
84+
}
85+
]
4086
}

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
website/** linguist-documentation

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [sidorares]

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "npm"
8+
directory: "/website"
9+
schedule:
10+
interval: "daily"

.github/workflows/benchmark.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Benchmark
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
workflow_dispatch:
9+
10+
env:
11+
MYSQL_PORT: 3306
12+
MYSQL_USER: root
13+
MYSQL_DATABASE: test
14+
15+
jobs:
16+
benchmark:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [20.x]
22+
mysql-version: ["mysql:8.0.18"]
23+
use-compression: [0]
24+
use-tls: [0]
25+
26+
name: Performance regression check
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
# - name: Set up MySQL
32+
# run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_ROOT_PASSWORD=${{ env.MYSQL_PASSWORD }} -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/test/fixtures/custom-conf:/etc/mysql/conf.d -v $PWD/test/fixtures/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
33+
- name: Set up Node.js ${{ matrix.node-version }}
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: ${{ matrix.node-version }}
37+
38+
- name: Cache dependencies
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.npm
42+
key: npm-linux-${{ hashFiles('package-lock.json') }}
43+
restore-keys: npm-linux-
44+
45+
- name: Install npm dependencies
46+
run: npm ci
47+
48+
# - name: Wait mysql server is ready
49+
# run: node tools/wait-up.js
50+
51+
- name: Run benchmark
52+
run: node benchmarks/benchmark.js | tee output.txt
53+
54+
- name: Download previous benchmark data
55+
uses: actions/cache@v1
56+
with:
57+
path: ./cache
58+
key: ${{ runner.os }}-benchmark
59+
60+
- name: Store benchmark result
61+
uses: benchmark-action/github-action-benchmark@v1
62+
with:
63+
tool: 'benchmarkjs'
64+
output-file-path: output.txt
65+
external-data-json-path: ./cache/benchmark-data.json
66+
fail-on-alert: false
67+
auto-push: false
68+
alert-threshold: '150%'
69+
github-token: ${{ secrets.GITHUB_TOKEN }}
70+
comment-on-alert: true
71+
alert-comment-cc-users: '@sidorares'

.github/workflows/ci-coverage.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI - Coverage
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ master ]
7+
8+
workflow_dispatch:
9+
10+
env:
11+
MYSQL_PORT: 3306
12+
MYSQL_USER: root
13+
MYSQL_DATABASE: test
14+
15+
jobs:
16+
coverage:
17+
permissions: write-all
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
node-version: [20.x]
23+
mysql-version: ["mysql:5.7", "mysql:8.0.33"]
24+
use-compression: [0, 1]
25+
use-tls: [0, 1]
26+
mysql_connection_url_key: [""]
27+
env:
28+
MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }}
29+
30+
name: Coverage ${{ matrix.node-version }} - DB ${{ matrix.mysql-version }}${{ matrix.mysql_connection_url_key }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up MySQL
36+
if: ${{ matrix.mysql-version }}
37+
run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/test/fixtures/custom-conf:/etc/mysql/conf.d -v $PWD/test/fixtures/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
38+
39+
- name: Set up Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
44+
- name: Cache dependencies
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.npm
48+
key: npm-linux-${{ hashFiles('package-lock.json') }}
49+
restore-keys: npm-linux-
50+
51+
- name: Install npm dependencies
52+
run: npm ci
53+
54+
- name: Wait mysql server is ready
55+
if: ${{ matrix.mysql-version }}
56+
run: node tools/wait-up.js
57+
58+
- name: Run tests
59+
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run coverage-test
60+
61+
- name: Upload coverage reports to Codecov
62+
uses: codecov/codecov-action@v4
63+
with:
64+
token: ${{ secrets.CODECOV_TOKEN }}
65+
flags: compression-${{ matrix.use-compression }},tls-${{ matrix.use-tls }}
66+
name: codecov-umbrella-${{ matrix.node-version }}-${{ matrix.mysql-version }}-compression-${{ matrix.use-compression }}-tls-${{ matrix.use-tls }}

.github/workflows/ci-linux.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI - Linux
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
workflow_dispatch:
9+
10+
env:
11+
MYSQL_PORT: 3306
12+
MYSQL_USER: root
13+
MYSQL_DATABASE: test
14+
15+
jobs:
16+
tests-linux:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [18.x, 20.x, 21.x]
22+
mysql-version: ["mysql:8.0.33"]
23+
use-compression: [0, 1]
24+
use-tls: [0, 1]
25+
mysql_connection_url_key: [""]
26+
# TODO - add mariadb to the matrix. currently few tests are broken due to mariadb incompatibilities
27+
env:
28+
MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }}
29+
30+
name: Node.js ${{ matrix.node-version }} - DB ${{ matrix.mysql-version }}${{ matrix.mysql_connection_url_key }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up MySQL
36+
if: ${{ matrix.mysql-version }}
37+
run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/test/fixtures/custom-conf:/etc/mysql/conf.d -v $PWD/test/fixtures/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
38+
39+
- name: Set up Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
44+
- name: Cache dependencies
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.npm
48+
key: npm-linux-${{ hashFiles('package-lock.json') }}
49+
restore-keys: npm-linux-
50+
51+
- name: Install npm dependencies
52+
run: npm ci
53+
54+
- name: Wait mysql server is ready
55+
if: ${{ matrix.mysql-version }}
56+
run: node tools/wait-up.js
57+
58+
- name: Run tests
59+
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run test
60+
61+
tests-linux-bun:
62+
runs-on: ubuntu-latest
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
bun-version: [latest, canary]
67+
mysql-version: ["mysql:8.0.33"]
68+
use-compression: [0, 1]
69+
use-tls: [0,1]
70+
71+
name: Bun ${{ matrix.bun-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
- name: Set up MySQL
76+
run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/test/fixtures/custom-conf:/etc/mysql/conf.d -v $PWD/test/fixtures/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
77+
78+
- name: Set up Bun ${{ matrix.bun-version }}
79+
uses: oven-sh/setup-bun@v1
80+
with:
81+
bun-version: ${{ matrix.bun-version }}
82+
83+
- name: Set up Node.js
84+
uses: actions/setup-node@v4
85+
with:
86+
node-version: 20
87+
- name: Cache dependencies
88+
uses: actions/cache@v4
89+
with:
90+
path: ~/.npm
91+
key: npm-linux-${{ hashFiles('package-lock.json') }}
92+
restore-keys: npm-linux-
93+
94+
- name: Install npm dependencies
95+
run: npm ci
96+
97+
- name: Wait mysql server is ready
98+
run: node tools/wait-up.js
99+
100+
# todo: run full test suite once test createServer is implemented using Bun.listen
101+
- name: run tests
102+
env:
103+
MYSQL_USER: ${{ env.MYSQL_USER }}
104+
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
105+
MYSQL_PORT: ${{ env.MYSQL_PORT }}
106+
MYSQL_USE_COMPRESSION: ${{ matrix.use-compression }}
107+
MYSQL_USE_TLS: ${{ matrix.use-tls }}
108+
FILTER: test-select-1|test-select-ssl
109+
run: bun run test:bun
110+
timeout-minutes: 1

0 commit comments

Comments
 (0)