elysia-mariadb
v1.0.0
Published
## Installing ```bash bun add elysia-mariadb ```
Downloads
3
Readme
Elysia MariaDB
Installing
bun add elysia-mariadb
Example code:
const app = new Elysia()
.use(
elysiaMariaDB({
host: 'localhost',
port: 3306,
user: 'USERNAME',
password: 'PASSWORD',
database: 'DATABASE',
connectionLimit: 5,
timezone: '+00:00',
}),
)
.get('/', async ({ db }) => {
const users = await db.query('SELECT * FROM users');
return users.map((item: any) => ({
name: item.name,
}));
})
.listen(3000);