QuymnyDB QuymnyDB
Basics

SQL Queries

SQL is the standard language for interacting with relational databases. In QuymnyDB you send the same queries you'd run locally with xampp, mysql, postgres or any other SQL database — they just execute against your cloud database.

Common query patterns

-- Create database
CREATE DATABASE mychool;

-- Employees table
CREATE TABLE employees (
    employee_id INT PRIMARY KEY AUTO_INCREMENT,
    first_name VARCHAR(50) NOT NULL,
    last_name VARCHAR(50) NOT NULL,
    email VARCHAR(100) UNIQUE,
    phone VARCHAR(20),
    job_title VARCHAR(100),
    salary DECIMAL(10,2),
    hire_date DATE
);

-- Customers table
CREATE TABLE customers (
    customer_id INT PRIMARY KEY AUTO_INCREMENT,
    first_name VARCHAR(50) NOT NULL,
    last_name VARCHAR(50) NOT NULL,
    email VARCHAR(100) UNIQUE,
    phone VARCHAR(20),
    address VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

QuymnyDB Shell

Use the QuymnyDB shell to run SQL queries directly against your cloud database. The shell provides a convenient interface for executing queries and managing your database schema. In this shell you don't need to run queries such as USE database_name — once you are in the database name displaying at the header, it's automatically the current database you are working on.

Error Handling

If you type a query incorrectly, the shell will display an error message indicating the issue. Make sure the related data you are trying to run the query against is available in the database, and that you are typing the query correctly. This is mostly the case when altering, dropping, or inserting data into a table or database — if the table or database is not available in the current database, the shell will show an error. But once you type your queries correctly and the related data exists, the shell will execute the query successfully and display the result.

Setup

How to connect to Database

Grab your QuymnyDB connection URL and token key from the dashboard, then open a connection.

JavaScript

import { QuymnyDB } from "quymnydb";

const db = new QuymnyDB({
  url: "https://qdb-worker.quymny.com/execute-sql",
  tokenKey: "YOUR_TOKEN_KEY"
});

await db.connect();
console.log("Connected ✓");

Tip: keep the token key server-side. Never ship it in a browser bundle.

Python

from quymnydb import QuymnyDB

db = QuymnyDB(
    url="https://qdb-worker.quymny.com/execute-sql",
    token_key="YOUR_TOKEN_KEY"
)
Write

How to send data

Sending data means running an INSERT (or UPDATE) against your cloud SQL instance.

await db.run(
  "INSERT INTO posts (title, body) VALUES (?, ?)",
  ["Hello QuymnyDB", "My first cloud SQLite post"]
);

Batch inserts are supported via db.batch([...]) — much faster for bulk writes.

Transactions

How to commit data

Wrap related writes in a transaction so they either all succeed or all roll back.

await db.transaction(async (tx) => {
  await tx.run("UPDATE accounts SET balance = balance - 50 WHERE id = 1");
  await tx.run("UPDATE accounts SET balance = balance + 50 WHERE id = 2");
});
// auto-commits on success, rolls back on throw
Read

How to retrieve data

Use db.all() for many rows, db.get() for one, and db.each() to stream.

const rows = await db.all("SELECT * FROM posts ORDER BY created_at DESC LIMIT 20");
const one  = await db.get("SELECT * FROM posts WHERE id = ?", [42]);

Results come back as plain JSON objects — no ORM required.

Support

Help

Stuck? Here's how to get unstuck fast.

  • Check the docs at docs.quymnydb.cloud
  • Search or open an issue on our community forum
  • Email support@quymny.com