DEV Community

Cover image for Introducing Qiu!
mahdi
mahdi

Posted on

Introducing Qiu!

I’m thrilled to announce the release of Qiu – a no-nonsense SQL query runner designed to make raw SQL fun again. Let’s be honest, ORMs have their place, but they can get a bit overwhelming when all you want is to write simple SQL. I’ve always enjoyed crafting raw SQL queries, but I realized that I needed practice — a lot of it. That’s where Qiu comes in.

With Qiu, there’s no more wrestling with bulky ORMs or getting lost in layers of abstraction. It’s a lightweight tool designed for developers who, like me, want to focus on mastering SQL without the extra noise. Writing raw SQL should be empowering, not a chore, and Qiu makes that happen.

Why Qiu?

I created Qiu because I wanted a simple yet powerful way to run raw SQL queries, practice them, and avoid the typical hassles of ORMs. Whether you’re a database newbie looking to sharpen your SQL skills or a seasoned developer who prefers simplicity over abstraction, Qiu has got you covered.

Features

  • Direct SQL Execution: Forget the layers of ORM and run your raw SQL queries directly.
  • Database Support: Currently supports PostgreSQL, MySQL, and MariaDB.
  • Efficient Task Queue: Queue your SQL commands for smooth execution without clogging up your system.
  • Rate Limiting: Built-in rate limiter to handle your query execution safely and efficiently.
  • File Support: Execute queries directly from .sql files.

How to Install

Getting started with Qiu is as easy as:

npm install @medishn/gland-qiu
Enter fullscreen mode Exit fullscreen mode

Usage Example

Here’s how Qiu works in action:

import { Qiu } from '@medishn/gland-qiu';

const db = new Qiu('mysql', '-u username -ppassword');
// Before that, you have to create the database Like: CREATE DATABASE db
db.use('my_database');  

// Running a raw query
await db.exec('SELECT * FROM users;');

// Running a query from an SQL file
await db.exec('./queries/create_table.sql');
Enter fullscreen mode Exit fullscreen mode

Why You’ll Love Qiu:

  • No ORM Frustrations: Sometimes, ORMs add unnecessary complexity. With Qiu, you can focus purely on your SQL.
  • Simple & Lightweight: Perfect for projects where you just need to run raw queries without the heavy baggage.
  • Practice SQL Efficiently: Ideal for honing your raw SQL skills and getting hands-on practice.

Conclusion

Qiu was born from my desire to get better at SQL and enjoy the process without the distractions of ORMs. If you're tired of heavy abstractions and just want a straightforward SQL runner, give Qiu a try!

Explore more on the GitHub repository or npm package page.

Top comments (0)