Skip to content

Commit

Permalink
Merge pull request #87 from invisal/develop
Browse files Browse the repository at this point in the history
deployment
  • Loading branch information
invisal authored Apr 19, 2024
2 parents 25fcf99 + e97503b commit 245b4d2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@libsqlstudio/studio",
"version": "0.3.1",
"version": "0.4.0",
"private": false,
"scripts": {
"dev": "next dev --turbo",
Expand Down Expand Up @@ -73,6 +73,7 @@
"dotenv": "^16.4.5",
"drizzle-orm": "^0.30.1",
"eslint-plugin-jest": "^27.6.3",
"libsql-stateless-easy": "^1.6.2",
"lucia": "^3.1.1",
"lucide-react": "^0.309.0",
"magic-bytes.js": "^1.10.0",
Expand Down
23 changes: 18 additions & 5 deletions studio/src/drivers/turso-driver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
InStatement,
ResultSet,
} from "@libsql/client/web";
import { createClient as createClientStateless } from "libsql-stateless-easy";
import {
SqliteLikeBaseDriver,
DatabaseHeader,
Expand Down Expand Up @@ -64,11 +65,23 @@ export default class TursoDriver extends SqliteLikeBaseDriver {
this.authToken = authToken;
this.bigInt = bigInt;

this.client = createClient({
url: this.endpoint,
authToken: this.authToken,
intMode: bigInt ? "bigint" : "number",
});
if (
url.startsWith("libsql://") ||
url.startsWith("http://") ||
url.startsWith("https://")
) {
this.client = createClientStateless({
url: this.endpoint.replace(/^libsql:\/\//, "https://"),
authToken: this.authToken,
intMode: bigInt ? "bigint" : "number",
});
} else {
this.client = createClient({
url: this.endpoint,
authToken: this.authToken,
intMode: bigInt ? "bigint" : "number",
});
}
}

supportBigInt(): boolean {
Expand Down

0 comments on commit 245b4d2

Please sign in to comment.