23 lines
754 B
Markdown
23 lines
754 B
Markdown
We have released [SQLite Proxy Driver](https://github.com/drizzle-team/drizzle-orm/tree/main/examples/sqlite-proxy)
|
|
|
|
---
|
|
|
|
Perfect way to setup custom logic for database calls instead of predefined drivers
|
|
|
|
Should work well with serverless apps 🚀
|
|
|
|
```typescript
|
|
// Custom Proxy HTTP driver
|
|
const db = drizzle(async (sql, params, method) => {
|
|
try {
|
|
const rows = await axios.post('http://localhost:3000/query', { sql, params, method });
|
|
|
|
return { rows: rows.data };
|
|
} catch (e: any) {
|
|
console.error('Error from sqlite proxy server: ', e.response.data)
|
|
return { rows: [] };
|
|
}
|
|
});
|
|
```
|
|
|
|
> For more example you can check [full documentation](https://github.com/drizzle-team/drizzle-orm/tree/main/examples/sqlite-proxy) |