Last active
          May 22, 2025 11:51 
        
      - 
      
 - 
        
Save Hiweus/d432c87a0d0b97e327efa3df3a819ab0 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
Hiweus revised this gist
May 22, 2025 . 1 changed file with 26 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import { createClient } from "@libsql/client"; import crypto from 'node:crypto' const turso = createClient({ url: "http://127.0.1:8080", authToken: "...JWT generated from private key consult https://gist.github.com/Hiweus/15e2f94fb831b6ee389a4f21c9b460d6", }) await turso.execute("create table if not exists user (id integer primary key autoincrement, name TEXT) strict") for(let i = 0; i < 100; i++) { await turso.execute( "insert into user (name) values (?)", [crypto.randomUUID()] ) } while(true) { const { rows } = await turso.execute( "select * from user where id = ? or name = ?", [crypto.randomInt(0, 10000), crypto.randomUUID()] ) console.log(rows) await new Promise((resolve) => setTimeout(resolve, 10)) }  - 
        
Hiweus created this gist
May 22, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ docker run -it -p 8080:8080 \ -e SQLD_AUTH_JWT_KEY_FILE=/app/jwt_public.key \ -e SQLD_DB_PATH=/app/database \ -v ./jwt_public.key:/app/jwt_public.key \ -v ./database:/app/database \ ghcr.io/tursodatabase/libsql-server:41eae61