home / kengdb / friendTb

friendTb

Table actions Table actions
  • Edit table schema

2 rows where friend_id = 1

✎ View and edit SQL

This data as json, CSV (advanced)

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

id ▼ user_id friend_id status created_at updated_at
2 23 23 1 1 accepted 2026-05-16 22:17:08 2026-05-16 22:17:08
3 25 25 1 1 pending 2026-05-20 23:08:04 2026-05-20 23:08:04

Advanced export

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

CSV options:

CREATE TABLE friendTb (
                id         INTEGER PRIMARY KEY AUTOINCREMENT,
                user_id    INTEGER NOT NULL REFERENCES userTb(id),
                friend_id  INTEGER NOT NULL REFERENCES userTb(id),
                status     TEXT    NOT NULL DEFAULT 'pending',
                created_at TEXT    NOT NULL DEFAULT (datetime('now','localtime')),
                updated_at TEXT    NOT NULL DEFAULT (datetime('now','localtime')),
                UNIQUE(user_id, friend_id)
            );
CREATE INDEX idx_friend_user ON friendTb(user_id, status);
CREATE INDEX idx_friend_friend ON friendTb(friend_id, status);
Powered by Datasette · Queries took 1.2ms