Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
23 changes: 11 additions & 12 deletions package-lock.json

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

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sqlitecloud/drivers",
"version": "1.0.401",
"version": "1.0.403",
"description": "SQLiteCloud drivers for Typescript/Javascript in edge, web and node clients",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down Expand Up @@ -48,13 +48,11 @@
"socket.io-client": "^4.8.1",
"whatwg-url": "^14.1.0"
},
"optionalDependencies": {
"@craftzdog/react-native-buffer": "^6.0.5",
"react-native-url-polyfill": "^2.0.0"
},
"peerDependencies": {
"react-native-quick-base64": "*",
"react-native-tcp-socket": "^6.2.0"
"react-native-tcp-socket": "^6.2.0",
"@craftzdog/react-native-buffer": "^6.0.5",
"react-native-url-polyfill": "^2.0.0"
},
"devDependencies": {
"@types/jest": "^29.5.14",
Expand Down
40 changes: 40 additions & 0 deletions test/clean.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* clean.test.ts - clean test databases
*/

import { describe, it } from '@jest/globals'
import { getChinookDatabase } from './shared'

describe.skip('clean test suite', () => {
it('should remove test databases from the project', async () => {
let chinook
try {
chinook = getChinookDatabase()
// Use the connect utility to execute SQL statements on the selected database
const result = await chinook.sql(`LIST DATABASES`)
const limit = 1000
let removed = []
let dbname = ''
for (let i = 0; i < result.length; i++) {
dbname = result[i].name
if ((dbname.startsWith('1brc') && dbname.includes('-2025')) || dbname.startsWith('testing-2025')) {
removed.push(dbname)
// console.log("remove ${dbname}")
const r = await chinook.sql(`REMOVE DATABASE ${dbname}`)
if (removed.length >= limit) {
break
}
}
}

// Build the object to be returned by your edge function
const message = `Number of databases: ${result.length}, removed ${removed.length}`

// Return the object from your edge function

console.debug({ message, removed })
} finally {
chinook?.close()
}
})
})
Loading