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 mychool;

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
);

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 won't 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

Connecting 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"
)

if db.connect():
    print("Connected ✓")
Write

Sending data

Batch inserting rows enables single-query execution for multiple records, significantly reducing HTTP network latency, minimizing database overhead, and boosting overall data ingestion throughput across high-performance web applications.

Python

# INSERT Multi-row
multi_row = db.execute("""
    INSERT INTO test_departments (id, name)
    VALUES (2, 'Design'), (3, 'Database'), (4, 'Management');
""")
print_json("Multi-row INSERT result", multi_row)

JavaScript

const multiRow = await db.execute(`
  INSERT INTO test_departments (id, name)
  VALUES (2, 'Design'), (3, 'Database'), (4, 'Management');
`);
console.log("Multi-row INSERT result:", multiRow);
Transactions

Committing data

Transaction batching bundles setup commands, parameterized insertions, and commit instructions into a single HTTP request, guaranteeing ACID compliance, atomic operations, and eliminating sequential network round-trips for multi-step updates.

Python

# -------------------------------------------------------
# TRANSACTION - COMMIT (SINGLE HTTP REQUEST)
# -------------------------------------------------------
try:
    tx_ops = [
        "BEGIN",
        ("INSERT INTO test_users (id, name, email, department_id, salary, active) VALUES (%s, %s, %s, %s, %s, %s)", [7, "Grace", "grace@example.com", 1, 88000, 1]),
        ("INSERT INTO test_posts (id, user_id, title, body) VALUES (%s, %s, %s, %s)", [4, 7, "Grace's Post", "Created inside a transaction"]),
        "COMMIT"
    ]
    
    # Map to arrays: strings get None for params, tuples get their query and params
    q_arr = [op if isinstance(op, str) else op[0] for op in tx_ops]
    p_arr = [None if isinstance(op, str) else op[1] for op in tx_ops]
    
    db.execute(q_arr, p_arr)
    print("Transaction committed successfully!")
except Exception as err:
    print(f"Transaction commit failed: {err}")

JavaScript

try {
  const txOps = [
    "BEGIN",
    ["INSERT INTO test_users (id, name, email, department_id, salary, active) VALUES (?, ?, ?, ?, ?, ?)", [7, "Grace", "grace@example.com", 1, 88000, 1]],
    ["INSERT INTO test_posts (id, user_id, title, body) VALUES (?, ?, ?, ?)", [4, 7, "Grace's Post", "Created inside a transaction"]],
    "COMMIT"
  ];

  const qArr = txOps.map(op => typeof op === 'string' ? op : op[0]);
  const pArr = txOps.map(op => typeof op === 'string' ? null : op[1]);

  await db.execute(qArr, pArr);
  console.log("Transaction committed successfully!");
} catch (err) {
  console.error("Transaction commit failed:", err);
}
Read

Retrieving data

Query execution retrieves structured relational data via SQL constructs like LEFT JOIN to highlight orphaned records, returning results in lightweight, predictable JSON structures without requiring complex ORM overhead.

Python

null_test = db.execute("""
    SELECT d.name AS department, u.name AS user_name
    FROM test_departments d LEFT JOIN test_users u ON d.id = u.department_id
    WHERE u.id IS NULL;
""")
print_json("Departments without users", null_test)

JavaScript

const nullTest = await db.execute(`
  SELECT d.name AS department, u.name AS user_name
  FROM test_departments d LEFT JOIN test_users u ON d.id = u.department_id
  WHERE u.id IS NULL;
`);
console.log("Departments without users:", nullTest);
Pricing

Free Database Tier

Get started for free with generous quotas designed for side projects, prototypes, and lightweight production workloads. This free plan has 500M queries / month for each database. If your app scale to millions your trafic will still be supported within the free tier.

Free Plan

$0 / month
  • Up to 10 Databases
  • 500M Queries / Month / database
  • 0.5 GB Storage
  • 100 GB Bandwidth

Databases aren't lost when your plan get downgraded, but the number of databases you can create is limited by your plan. If you purchase a plan with a lower database limit while the previous plan was high in databases limit, you won't be able to create new databases until you delete some existing ones or upgrade your plan. However if you are on the Standard plan and your account is downgraded, only the first 10 databases will remain active. The other 180 databases will remain inactive and won't be accessible via URL or token until you upgrade your plan or delete some existing databases. The same applies to the Pro plan if your account is downgraded to the Free plan.

Need help? Contact us to discuss your requirements.

Important

Database Tokens & Renaming

Every database in QuymnyDB is paired with an access token. Understanding how tokens work — especially when you rename a database — prevents broken connections in your apps.

Automatic token creation

When you create a database (or when one is provisioned for you), QuymnyDB automatically generates a unique token key for that database. The combination of the database URL and this token is what your application uses to authenticate and run SQL.

What happens when you rename a database

Renaming a database causes a new token to be issued for the new name. The previous token becomes invalid. If that database is already used in scripts, backends, mobile apps, or CI pipelines, you must update the token key (and any stored database name) in those places. Otherwise connections will fail with an authentication or “database not found” error.

Best practice

  • After renaming, open the Config panel → View Token and copy the new credentials.
  • Update environment variables / secrets in every service that connects to that database.
  • Prefer generating an extra named token for production so you can rotate credentials without renaming the database itself.
Getting started

Account Creation & Default Databases

New QuymnyDB accounts come ready to use. You do not need to create a database or generate a token before you can start running queries.

What you get on signup

When an account is created, QuymnyDB automatically provisions two default databases and generates a token for each of them. The database URL and token are immediately available in the dashboard (Config panel → View Token). You can connect from JavaScript, Python, or any HTTP client right away.

Optional custom tokens

The default tokens are sufficient for most projects. If you prefer stricter access control or want separate credentials for different environments (dev / staging / production), you can generate additional named tokens for any of your databases from the Config panel. You can also revoke and regenerate tokens at any time.

Summary

  • 2 default databases are created for every new account.
  • Each default database already has a working token.
  • Database URL + token = ready to use from day one.
  • Generate extra tokens whenever you need finer control or rotation.