Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ccb2dc7
Add MSSQL Server support to db0
vkuttyp Nov 27, 2025
351643d
testing fixed MSSQL support
vkuttyp Nov 27, 2025
ccb0822
added stored procedure tests
vkuttyp Nov 27, 2025
f0555c9
added test for json auto
vkuttyp Nov 27, 2025
bb523ac
.env.example updated
vkuttyp Nov 28, 2025
081db35
added sql server in docker-compose.yml
vkuttyp Nov 29, 2025
30de038
Added create database test
vkuttyp Nov 29, 2025
4efde4e
test updates
vkuttyp Nov 29, 2025
e7ac3e9
chore: apply automated updates
autofix-ci[bot] Nov 29, 2025
4fe1fb6
Bug fix
vkuttyp Nov 29, 2025
e83f6d7
chore: apply automated updates
autofix-ci[bot] Nov 29, 2025
18425a6
fixed docker-compose.yml
vkuttyp Nov 29, 2025
9f38ae2
Fix TypeScript errors in MSSQL connector
vkuttyp Nov 29, 2025
ba0d00b
chore: apply automated updates
autofix-ci[bot] Nov 29, 2025
513c8e4
Trigger CI workflow
vkuttyp Nov 29, 2025
7998351
Add Codecov coverage upload to CI workflow
vkuttyp Nov 30, 2025
5295f64
Added more tests
vkuttyp Dec 2, 2025
561fd7b
chore: apply automated updates
autofix-ci[bot] Dec 2, 2025
a527256
Trigger CI workflow to test coverage and autofix
vkuttyp Dec 2, 2025
9007758
Upgraded tedious to the latest version and added more tests
vkuttyp Dec 7, 2025
a5fa0e0
chore: apply automated updates
autofix-ci[bot] Dec 7, 2025
f34f985
Merge branch 'main' into add-mssql-support
vkuttyp Feb 1, 2026
aed2083
Merge branch 'main' into add-mssql-support
vkuttyp Apr 9, 2026
e02e32a
chore: apply automated updates
autofix-ci[bot] Apr 9, 2026
14e143e
Merge branch 'main' into add-mssql-support
vkuttyp Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ PLANETSCALE_PASSWORD=password
# Cloudflare Hyperdrive
WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_POSTGRESQL=postgresql://test:test@localhost:5432/db0
WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_MYSQL=mysql://test:test@localhost:3306/db0

# MSSQL
MSSQL_HOST=localhost
MSSQL_DB_NAME=TestDB
MSSQL_PORT=1433
MSSQL_USERNAME=sa
MSSQL_PASSWORD=MyStrong!Passw0rd
Comment thread
vkuttyp marked this conversation as resolved.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ jobs:
- run: pnpm build
- run: pnpm test:types
- run: pnpm vitest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ services:
MYSQL_DATABASE: db0
MYSQL_USER: test
MYSQL_PASSWORD: test
mssql:
# https://hub.docker.com/_/microsoft-mssql-server
image: mcr.microsoft.com/mssql/server:2022-latest
network_mode: "host"
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "MyStrong!Passw0rd"
MSSQL_PID: "Developer"
1 change: 1 addition & 0 deletions docs/2.connectors/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Currently supported connectors:
- [Prisma Postgres](/connectors/postgresql#prisma-postgres)
- [MySQL](/connectors/mysql)
- [SQLite](/connectors/sqlite)
- [MSSQL](/connectors/mssql)

::read-more{to="https://github.com/unjs/db0/issues/32"}
See [unjs/db0#32](https://github.com/unjs/db0/issues/32) for the list of upcoming connectors.
Expand Down
30 changes: 30 additions & 0 deletions docs/2.connectors/mssql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
icon: devicon-plain:microsoftsqlserver
---

# MSSQL

> Connect DB0 to MSSQL Database using `tedious`

## Usage

For this connector, you need to install [`tedious`](https://www.npmjs.com/package/tedious) dependency:

:pm-install{name="tedious"}

Use `mssql` connector:

```js
import { createDatabase } from "db0";
import mssql from "db0/connectors/mssql";

const db = createDatabase(
mssql({
/* options */
}),
);
```

## Options

:read-more{to="https://tediousjs.github.io/tedious/api-connection.html#function_newConnection"}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
"pg": "^8.22.0",
"prettier": "^3.9.5",
"scule": "^1.3.0",
"tedious": "^19.1.3",
"typescript": "^5.9.3",
"vitest": "^4.1.0",
"wrangler": "^4.74.0"
"typescript": "^7.0.2",
"vitest": "^4.1.10",
"wrangler": "^4.110.0"
Comment on lines +70 to 76

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the duplicate dependency declarations and invalid JSON.

Lines 71-73 duplicate the declarations on lines 74-76, and line 73 is missing the comma required before the next property. This makes package.json unparsable and blocks installation, scripts, and CI. Retain one declaration for each package, using the intended updated versions.

Proposed fix
     "scule": "^1.3.0",
     "tedious": "^19.1.3",
-    "typescript": "^5.9.3",
-    "vitest": "^4.1.0",
-    "wrangler": "^4.74.0"
     "typescript": "^7.0.2",
     "vitest": "^4.1.10",
     "wrangler": "^4.110.0"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"tedious": "^19.1.3",
"typescript": "^5.9.3",
"vitest": "^4.1.0",
"wrangler": "^4.74.0"
"typescript": "^7.0.2",
"vitest": "^4.1.10",
"wrangler": "^4.110.0"
"tedious": "^19.1.3",
"typescript": "^7.0.2",
"vitest": "^4.1.10",
"wrangler": "^4.110.0"
🧰 Tools
🪛 Biome (2.5.3)

[error] 74-74: expected , but instead found "typescript"

(parse)


[error] 71-71: The key typescript was already declared.

(lint/suspicious/noDuplicateObjectKeys)


[error] 72-72: The key vitest was already declared.

(lint/suspicious/noDuplicateObjectKeys)


[error] 73-73: The key wrangler was already declared.

(lint/suspicious/noDuplicateObjectKeys)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 70 - 76, Clean up the dependency declarations in
package.json by removing the duplicate typescript, vitest, and wrangler entries,
retaining their intended updated versions. Restore valid JSON syntax by ensuring
the preceding dependency entry is properly comma-terminated.

Source: Linters/SAST tools

Expand All @@ -78,7 +82,8 @@
"drizzle-orm": "*",
"kysely": "*",
"mysql2": "*",
"sqlite3": "*"
"sqlite3": "*",
"tedious": "*"
},
"peerDependenciesMeta": {
"@libsql/client": {
Expand All @@ -96,6 +101,9 @@
"mysql2": {
"optional": true
},
"tedious": {
"optional": true
},
"@electric-sql/pglite": {
"optional": true
},
Expand Down
Loading