Gathering detailed insights and metrics for @medishn/gland-qiu
Gathering detailed insights and metrics for @medishn/gland-qiu
Gathering detailed insights and metrics for @medishn/gland-qiu
Gathering detailed insights and metrics for @medishn/gland-qiu
npm install @medishn/gland-qiu
Typescript
Module System
Min. Node Version
Node Version
NPM Version
71.9
Supply Chain
99.4
Quality
81
Maintenance
100
Vulnerability
100
License
TypeScript (92.89%)
Shell (3.93%)
Makefile (2.46%)
Dockerfile (0.71%)
Total Downloads
676
Last Day
1
Last Week
6
Last Month
9
Last Year
676
57 Commits
1 Branches
2 Contributors
Latest Version
2.1.2
Package Id
@medishn/gland-qiu@2.1.2
Unpacked Size
27.55 kB
Size
7.25 kB
File Count
18
NPM Version
10.8.1
Node Version
22.3.0
Publised On
01 Oct 2024
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
500%
6
Compared to previous week
Last month
-57.1%
9
Compared to previous month
Last year
0%
676
Compared to previous year
7
@medishn/gland-qiu
is a flexible and efficient database management tool that handles multiple SQL databases with powerful caching, rate-limiting, and task management functionalities for database operations.
.sql
files.Install the package using npm:
1npm install @medishn/gland-qiu
Below is an example of how to use the Qiu
class to run database queries:
To begin using Qiu
, you need to initialize it with your database type and connection string.
1import { Qiu } from "@medishn/gland-qiu"; 2 3const db = new Qiu({ 4 type: "postgresql", 5 connect: "psql -U postgres -d postgres -h localhost -p 5432", 6});
You can also specify MySQL or MariaDB:
1const db = new Qiu({ 2 type: "mysql", 3 connect: "mysql://username:password@localhost:3306/mydatabase", 4});
To execute a simple SQL query, use the exec
method.
1await db.exec("SELECT * FROM users;");
You can also run SQL queries stored in .sql
files:
1await db.exec("queries/init.sql", { isFile: true });
If you want the result of the query, set the value
option to true
.
1const result = await db.exec("SELECT * FROM users;", { value: true }); 2console.log(result);
Qiu
constructor(config: { connect: string, type: DatabaseSqlType })
exec(query: string, options?: { value?: boolean, isFile?: boolean }): Promise<void | string>
.sql
file.value
is set to true
, the result of the query will be returned. If isFile
is set to true
, the query will be treated as a file path.1import { Qiu } from "@medishn/gland-qiu"; 2 3const db = new Qiu({ 4 type: "postgresql", 5 connect: "psql -U postgres -d test_qiu -h localhost -p 5432", 6}); 7 8await db.exec("init.sql", { isFile: true }); 9const result = await db.exec("SELECT * FROM users;", { value: true }); 10console.log(result);
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
Details about the latest changes are documented in CHANGELOG.md.
If you find any security-related issues, please report them to bitsgenix@gmail.com.
This project is licensed under the MIT License. See the LICENSE file for details.
No vulnerabilities found.
No security vulnerabilities found.