home / bibliothek

loan

1 row where copy_id = 45

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: start_date (date), updated_at (date)

id ▼ uuid copy_id person_id direction start_date due_date returned_date updated_at deleted_at
2 045a5a9742384f4ae40de7b5763fdae8 45 45 Person 2 2 in 2026-11-16     2026-11-16T14:04:40.566Z  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE loan (
  id            INTEGER PRIMARY KEY,
  uuid          TEXT NOT NULL UNIQUE DEFAULT (lower(hex(randomblob(16)))),
  copy_id       INTEGER NOT NULL REFERENCES copy(id),
  person_id     INTEGER NOT NULL REFERENCES person(id),
  direction     TEXT NOT NULL CHECK (direction IN ('out','in')),  -- out = verliehen, in = geliehen
  start_date    TEXT,
  due_date      TEXT,
  returned_date TEXT,
  updated_at    TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
  deleted_at    TEXT
);
CREATE INDEX ix_loan_copy ON loan(copy_id);
Powered by Datasette · Queries took 6.582ms