MoodengSQL

SQL reference

Familiar SQL for most application workloads. This is a subset of PostgreSQL — test before migrating.

Supported

DDL

  • CREATE TABLE, DROP TABLE
  • CREATE INDEX
  • Constraints: PRIMARY KEY, NOT NULL, unique indexes

DML

  • INSERT, SELECT, UPDATE, DELETE
  • INSERT ... ON CONFLICT DO NOTHING
  • INSERT ... ON CONFLICT DO UPDATE (upsert)

Transactions

  • BEGIN, COMMIT, ROLLBACK

Queries

  • WHERE, ORDER BY, LIMIT, OFFSET
  • INNER JOIN
  • GROUP BY with aggregates
  • EXPLAIN — shows Index Scan vs Seq Scan

Types

INT4, INT8, FLOAT4, FLOAT8, TEXT, VARCHAR, BOOL, TIMESTAMP, JSON

Not yet supported

  • Replication and read replicas
  • Views, triggers, stored procedures
  • Window functions
  • MD5 authentication (use SCRAM-SHA-256)
  • Full PostgreSQL SQL compatibility

Example session

CREATE TABLE orders (
    id INT PRIMARY KEY,
    customer_id INT NOT NULL,
    total FLOAT8,
    created_at TIMESTAMP
);

CREATE INDEX idx_orders_customer ON orders (customer_id);

INSERT INTO orders VALUES (1, 42, 99.50, '2026-07-03 12:00:00');

SELECT o.id, o.total
FROM orders o
WHERE o.customer_id = 42
ORDER BY o.created_at DESC
LIMIT 10;

EXPLAIN SELECT * FROM orders WHERE id = 1;

ORM compatibility

Any client using the PostgreSQL wire protocol over TCP may work — psql, libpq, sqlx, Diesel, Prisma, etc. Run your actual queries against a test instance; unsupported SQL will error at parse or execute time.