home / kengdb / friendTb

friendTb

Table actions Table actions
  • Edit table schema

4 rows

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: user_id, friend_id, status, updated_at, created_at (date), updated_at (date)

id ▼ user_id friend_id status created_at updated_at
1 1 1 23 23 accepted 2026-05-16 22:03:33 2026-05-16 22:17:08
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
4 25 25 23 23 pending 2026-05-20 23:08:06 2026-05-20 23:08:06

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