DryORM
Code
Result
no cache
SQLite
PostgreSQL 17.4
MariaDB 11.4.5
Select a template
dryorm features
basic
bulk create
bulk fake
csv import
basic fk
self fk
user profile
dryorm tabular output
from django.db import models class Record(models.Model): x = models.CharField(max_length=10, null=True) y = models.CharField(max_length=10, null=True) z = models.CharField(max_length=10, null=True) class Meta: constraints = [ models.UniqueConstraint( models.functions.Coalesce('x', models.Value('')), models.functions.Coalesce('y', models.Value('')), models.functions.Coalesce('z', models.Value('')), name='unique_xyz_treat_null_as_empty' ) ] def run(): try: Record.objects.create(x='a', y='b', z='c') Record.objects.create(x='a', y='b', z='c') except Exception as e: print(f"Duplicate prevented for same triple") try: Record.objects.create(x=None, y='b', z='c') Record.objects.create(x=None, y='b', z='c') except Exception as e: print(f"Duplicate prevented for NULLs too") # Show all for r in Record.objects.all(): print(r.id, r.x, r.y, r.z)
Output
Show Template
No output.
Queries
TCL
T
DDL
D
SELECT
S
INSERT
I
UPDATE
U
DELETE
D
Queries
Q
(
0
)
No queries.
✖ Close
Save & Share
✖
private?
Save
Save & Copy