{ "db": "PostgreSQL", "0775cc960b9cbb1be71c4717f39fc3b1e5ff2f45fa653928bbafec112d5f6809": { "describe": { "columns": [ { "name": "user_id: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "session_id: SessionID", "ordinal": 1, "type_info": "Bytea" }, { "name": "code", "ordinal": 2, "type_info": "Text" }, { "name": "email", "ordinal": 3, "type_info": "Text" } ], "nullable": [ false, true, false, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select user_id as \"user_id: UserID\", session_id as \"session_id: SessionID\", code,\n email\n from verify_codes join users using (user_id)\n where user_id = $1" }, "09b7b91867e6b72294de43a604dde5cfaacc1e75eca1b3d15dec6ddf127729e0": { "describe": { "columns": [ { "name": "?column?", "ordinal": 0, "type_info": "Int4" } ], "nullable": [ null ], "parameters": { "Left": [ "Bytea" ] } }, "query": "update user_session\n set verified = true, verify_code = null\n where session_id = $1\n returning 1" }, "1a809571b386badb23dde5cec33f167ccdd7f195ab6c154f84dea0e9ca16b116": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, "Text", "Text", { "Custom": { "kind": { "Domain": "Bytea" }, "name": "secret_key" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "secret_key" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "verify_hash" } }, "Text" ] } }, "query": "insert into users (user_id, auth_salt, email, ka, wrapwrap_kb, verify_hash,\n display_name)\n values ($1, $2, $3, $4, $5, $6, $7)" }, "1d661b638cff8f0ab00e7c580db305dcdcc38c2747f4fb6db26ef205749ed59a": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [] } }, "query": "call prune_expired_tokens()" }, "1dbd6bcfd8f5b9ba10688a7e6ba6c6b2479c8a6de6dcdd6b77f727de421a9e13": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [] } }, "query": "call prune_expired_verify_codes()" }, "20a6d965b2b3e9fe8c403c686695a032fcb1bf8774d92f39fdd867a0964a2e3e": { "describe": { "columns": [ { "name": "?column?", "ordinal": 0, "type_info": "Int4" } ], "nullable": [ null ], "parameters": { "Left": [ "Text" ] } }, "query": "delete from invite_codes where code = $1 and expires_at > now() returning 1" }, "250d2e6c4d9184d534cc08c44d97c933e252923a097728a2c9663591cbc9fe34": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "device_id" } }, "Bytea" ] } }, "query": "update user_session set device_id = $1 where session_id = $2" }, "28115effdfc060af711db170ea566e6eaba0a8ed77966443033fe0409c3e4dbd": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, "Text", { "Custom": { "kind": { "Domain": "Bytea" }, "name": "secret_key" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "verify_hash" } } ] } }, "query": "call reset_user_auth($1, $2, $3, $4)" }, "2c8a4f47fa20723d24beb958a3bedc0c36b40b211e8c3fea96f6a32d6ddaa684": { "describe": { "columns": [ { "name": "?column?", "ordinal": 0, "type_info": "Int4" } ], "nullable": [ null ], "parameters": { "Left": [ "Bytea", "Bytea" ] } }, "query": "delete from device where user_id = $1 and device_id = $2 returning 1" }, "2ca0ad391bc6433cb9caf4cc7b14ff12ef29f64ca721d50af45d023b693e6919": { "describe": { "columns": [ { "name": "user_id: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "session_id: SessionID", "ordinal": 1, "type_info": "Bytea" }, { "name": "code", "ordinal": 2, "type_info": "Text" } ], "nullable": [ false, true, false ], "parameters": { "Left": [ "Bytea", "Text" ] } }, "query": "delete from verify_codes\n where user_id = $1 and code = $2\n returning user_id as \"user_id: UserID\", session_id as \"session_id: SessionID\",\n code" }, "2d99a9a6c5026bf018b999b6813798ea1dba411bae3961248ac552411b6d460a": { "describe": { "columns": [ { "name": "user_id: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "client_id", "ordinal": 1, "type_info": "Text" }, { "name": "scope: ScopeSet", "ordinal": 2, "type_info": "Text" }, { "name": "parent_refresh: OauthTokenID", "ordinal": 3, "type_info": "Bytea" }, { "name": "parent_session: SessionID", "ordinal": 4, "type_info": "Bytea" }, { "name": "expires_at!", "ordinal": 5, "type_info": "Timestamptz" } ], "nullable": [ false, false, false, true, true, true ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select user_id as \"user_id: UserID\", client_id, scope as \"scope: ScopeSet\",\n parent_refresh as \"parent_refresh: OauthTokenID\",\n parent_session as \"parent_session: SessionID\",\n expires_at as \"expires_at!\"\n from oauth_token\n where id = $1 and kind = 'access' and expires_at > now()" }, "2fb1e56d01c53f2d2b7c64409da6118018bd76c47108438d6664c5092c9f047e": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Bytea" ] } }, "query": "delete from oauth_token where id = $1" }, "3346dd1d2775de8fbf9a36a95812aa55904e4d4db9e626cd69e04e896ba0fc5d": { "describe": { "columns": [ { "name": "index", "ordinal": 0, "type_info": "Int8" }, { "name": "command", "ordinal": 1, "type_info": "Text" }, { "name": "payload", "ordinal": 2, "type_info": "Json" }, { "name": "expires", "ordinal": 3, "type_info": "Timestamptz" }, { "name": "sender", "ordinal": 4, "type_info": "Varchar" } ], "nullable": [ false, false, false, false, true ], "parameters": { "Left": [ "Int8", "Bytea", "Bytea", "Int8" ] } }, "query": "select index, command, payload, expires, sender\n from device_commands join device using (device_id)\n where index >= $1 and device_id = $2 and user_id = $3\n order by index\n limit $4" }, "3a857907a2bf4014a0cd56f4fd7ff50fe41332e9d282a87fa1ee18fccf227cbe": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "oauth_auth_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, "Text", "Text", { "Custom": { "kind": { "Enum": [ "online", "offline" ] }, "name": "oauth_access_type" } }, "Text", "Text", "Timestamptz" ] } }, "query": "insert into oauth_authorization (id, user_id, client_id, scope, access_type,\n code_challenge, keys_jwe, auth_at)\n values ($1, $2, $3, $4, $5, $6, $7, $8)" }, "3b1f4bf37ce4c8ccee3c7a39a69053fe36b5c0b4fcbbff9260096a68fa7c68a3": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Bytea", "Text", { "Custom": { "kind": { "Domain": "Bytea" }, "name": "secret_key" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "verify_hash" } } ] } }, "query": "update users\n set auth_salt = $2, wrapwrap_kb = $3, verify_hash = $4\n where user_id = $1" }, "4ae6964de7c75cf6494732a16a7ea5372ebf5c6aefb7acbd4e4e722968967321": { "describe": { "columns": [ { "name": "user_id: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "client_id", "ordinal": 1, "type_info": "Text" }, { "name": "scope: ScopeSet", "ordinal": 2, "type_info": "Text" }, { "name": "session_id: SessionID", "ordinal": 3, "type_info": "Bytea" } ], "nullable": [ false, false, false, true ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select user_id as \"user_id: UserID\", client_id, scope as \"scope: ScopeSet\",\n session_id as \"session_id: SessionID\"\n from oauth_token\n where id = $1 and kind = 'refresh'" }, "51b56a1a77411b06b6ebb93f986da2861ad75be55dc20b650eab87ba4fe0a8dd": { "describe": { "columns": [ { "name": "auth_salt: String", "ordinal": 0, "type_info": "Text" }, { "name": "email", "ordinal": 1, "type_info": "Text" }, { "name": "ka: SecretKey", "ordinal": 2, "type_info": "Bytea" }, { "name": "wrapwrap_kb: SecretKey", "ordinal": 3, "type_info": "Bytea" }, { "name": "verify_hash: VerifyHash", "ordinal": 4, "type_info": "Bytea" }, { "name": "display_name", "ordinal": 5, "type_info": "Text" }, { "name": "verified", "ordinal": 6, "type_info": "Bool" } ], "nullable": [ false, false, false, false, false, true, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select auth_salt as \"auth_salt: String\", email,\n ka as \"ka: SecretKey\", wrapwrap_kb as \"wrapwrap_kb: SecretKey\",\n verify_hash as \"verify_hash: VerifyHash\", display_name, verified\n from users\n where user_id = $1" }, "6266ac82d35ed2d8f6d17f8c354b0a4c4386254a5078f33eca3b6aa57e18c916": { "describe": { "columns": [ { "name": "device_id!: DeviceID", "ordinal": 0, "type_info": "Bytea" }, { "name": "name!", "ordinal": 1, "type_info": "Text" }, { "name": "type_!", "ordinal": 2, "type_info": "Text" }, { "name": "push: DevicePush", "ordinal": 3, "type_info": { "Custom": { "kind": { "Composite": [ [ "callback", "Text" ], [ "public_key", "Text" ], [ "auth_key", "Text" ] ] }, "name": "device_push_info" } } }, { "name": "available_commands!: DeviceCommands", "ordinal": 4, "type_info": { "Custom": { "kind": { "Array": { "Custom": { "kind": { "Composite": [ [ "name", "Text" ], [ "body", "Text" ] ] }, "name": "device_command" } } }, "name": "_device_command" } } }, { "name": "push_expired!", "ordinal": 5, "type_info": "Bool" }, { "name": "location!", "ordinal": 6, "type_info": "Jsonb" }, { "name": "last_active!", "ordinal": 7, "type_info": "Timestamptz" } ], "nullable": [ null, null, null, null, null, null, null, null ], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "device_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, "Text", "Text", { "Custom": { "kind": { "Composite": [ [ "callback", "Text" ], [ "public_key", "Text" ], [ "auth_key", "Text" ] ] }, "name": "device_push_info" } }, { "Custom": { "kind": { "Array": { "Custom": { "kind": { "Composite": [ [ "name", "Text" ], [ "body", "Text" ] ] }, "name": "device_command" } } }, "name": "_device_command" } }, "Jsonb" ] } }, "query": "select device_id as \"device_id!: DeviceID\", name as \"name!\", type as \"type_!\",\n push as \"push: DevicePush\",\n available_commands as \"available_commands!: DeviceCommands\",\n push_expired as \"push_expired!\", location as \"location!\",\n coalesce(last_active, to_timestamp(0)) as \"last_active!\"\n from insert_or_update_device($1, $2, $3, $4, $5, $6, $7) as iud\n left join user_session using (device_id)" }, "6490a0bfec6cf91bb4a0c507456be07fbbc7b742c0327cd4f912ef70e9d2394a": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Text", "Timestamptz" ] } }, "query": "insert into invite_codes (code, expires_at) values ($1, $2)" }, "67ebf7c646aa2e33dea84cea3c7af4a75b5e89509effd96d671112d4b7473d70": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "session_id" } }, "Text" ] } }, "query": "insert into verify_codes (user_id, session_id, code)\n values ($1, $2, $3)" }, "6e51008763091f55a4bc6db5ad719814430d3e910a67e1387ccda35547903a6c": { "describe": { "columns": [ { "name": "id: AvatarID", "ordinal": 0, "type_info": "Bytea" }, { "name": "data", "ordinal": 1, "type_info": "Bytea" }, { "name": "content_type", "ordinal": 2, "type_info": "Text" } ], "nullable": [ false, false, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select id as \"id: AvatarID\", data, content_type\n from user_avatars\n where id = $1" }, "6e84f90266300a757d50bb602d2b6aa1a9c086246778abf073354942f106aa32": { "describe": { "columns": [ { "name": "client_id?", "ordinal": 0, "type_info": "Text" }, { "name": "device_id?: DeviceID", "ordinal": 1, "type_info": "Bytea" }, { "name": "session_token_id?: SessionID", "ordinal": 2, "type_info": "Bytea" }, { "name": "refresh_token_id?: OauthTokenID", "ordinal": 3, "type_info": "Bytea" }, { "name": "device_type?", "ordinal": 4, "type_info": "Text" }, { "name": "name?", "ordinal": 5, "type_info": "Text" }, { "name": "created_time?", "ordinal": 6, "type_info": "Timestamptz" }, { "name": "last_access_time?", "ordinal": 7, "type_info": "Timestamptz" }, { "name": "scope?", "ordinal": 8, "type_info": "Text" } ], "nullable": [ false, false, false, false, false, false, null, true, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select\n ot.client_id as \"client_id?\",\n d.device_id as \"device_id?: DeviceID\",\n us.session_id as \"session_token_id?: SessionID\",\n ot.id as \"refresh_token_id?: OauthTokenID\",\n d.type as \"device_type?\",\n d.name as \"name?\",\n coalesce(d.created_at, us.created_at, ot.created_at) as \"created_time?\",\n us.last_active as \"last_access_time?\",\n ot.scope as \"scope?\"\n from device d\n full outer join user_session us on (d.device_id = us.device_id)\n full outer join oauth_token ot on (us.session_id = ot.session_id)\n where\n (ot.kind is null or ot.kind = 'refresh')\n and $1 in (d.user_id, us.user_id, ot.user_id)\n order by d.device_id" }, "71274c082aa53ef6d50aedf935ea7ae8fc2b4abb9549083d4e04d0c52907db30": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Bytea", "Text" ] } }, "query": "update users\n set display_name = $2\n where user_id = $1" }, "71531a84073d291f64f413f39af5e634eb5c55b1003cd70a81e32990555ce754": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "key_fetch_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "hawk_key" } }, "Bytea" ] } }, "query": "insert into key_fetch (id, hmac_key, keys) values ($1, $2, $3)" }, "762e8a42405b37ed74696f8f09aab8de82cbb564b21e5126c1ff0faeb7c872a1": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "avatar_id" } }, "Bytea", "Text" ] } }, "query": "insert into user_avatars (user_id, id, data, content_type)\n values ($1, $2, $3, $4)\n on conflict (user_id) do update set\n id = $2, data = $3, content_type = $4" }, "7cb2caaa204ec71a49a4e70426c549e5899f9c2c606055aa217e1349f6774dc5": { "describe": { "columns": [ { "name": "?column?", "ordinal": 0, "type_info": "Int4" } ], "nullable": [ null ], "parameters": { "Left": [ "Bytea" ] } }, "query": "update users set verified = true where user_id = $1 returning 1" }, "7d5dde8d94f2e93415c7e6a2e52bb998d7790bd2fb37b9eaf6270331210ebd2b": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Text" ] } }, "query": "delete from users where email = lower($1)" }, "8234a164578e19107e610122ae2f07c0ac77dda7260b3eba70cc51fd4b17e15e": { "describe": { "columns": [ { "name": "hmac_key: HawkKey", "ordinal": 0, "type_info": "Bytea" }, { "name": "user_id: UserID", "ordinal": 1, "type_info": "Bytea" }, { "name": "forgot_code", "ordinal": 2, "type_info": "Text" } ], "nullable": [ false, false, true ], "parameters": { "Left": [ "Bytea", "Bool" ] } }, "query": "delete from password_change_tokens\n where id = $1 and expires_at > now() and (forgot_code is not null) = $2\n returning hmac_key as \"hmac_key: HawkKey\", user_id as \"user_id: UserID\",\n forgot_code" }, "86eb609c6a307fac53b3bf7d673683b1a69a695eb02a6832cc5efc982abb3fa9": { "describe": { "columns": [ { "name": "index", "ordinal": 0, "type_info": "Int8" } ], "nullable": [ false ], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "device_id" } }, "Text", "Json", "Timestamptz", "Varchar" ] } }, "query": "insert into device_commands (device_id, command, payload, expires, sender)\n values ($1, $2, $3, $4, $5)\n returning index" }, "8b838aca5cdd674e44fed8f8c4bca06e0534c48d66c1c8a11b0f13ae67c4dc06": { "describe": { "columns": [ { "name": "device_id: DeviceID", "ordinal": 0, "type_info": "Bytea" }, { "name": "name", "ordinal": 1, "type_info": "Text" }, { "name": "type_", "ordinal": 2, "type_info": "Text" }, { "name": "push: DevicePush", "ordinal": 3, "type_info": { "Custom": { "kind": { "Composite": [ [ "callback", "Text" ], [ "public_key", "Text" ], [ "auth_key", "Text" ] ] }, "name": "device_push_info" } } }, { "name": "available_commands: DeviceCommands", "ordinal": 4, "type_info": { "Custom": { "kind": { "Array": { "Custom": { "kind": { "Composite": [ [ "name", "Text" ], [ "body", "Text" ] ] }, "name": "device_command" } } }, "name": "_device_command" } } }, { "name": "push_expired", "ordinal": 5, "type_info": "Bool" }, { "name": "location", "ordinal": 6, "type_info": "Jsonb" }, { "name": "last_active!", "ordinal": 7, "type_info": "Timestamptz" } ], "nullable": [ false, false, false, true, false, false, false, null ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select d.device_id as \"device_id: DeviceID\", d.name, d.type as type_,\n d.push as \"push: DevicePush\",\n d.available_commands as \"available_commands: DeviceCommands\",\n d.push_expired, d.location, coalesce(us.last_active, to_timestamp(0)) as \"last_active!\"\n from device d left join user_session us using (device_id)\n where d.user_id = $1" }, "8bdcb263a11f3923370a538efcd441b87d6250a8c04f0ff61353dd60e3521111": { "describe": { "columns": [ { "name": "hmac_key: HawkKey", "ordinal": 0, "type_info": "Bytea" }, { "name": "keys", "ordinal": 1, "type_info": "Bytea" } ], "nullable": [ false, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "delete from key_fetch\n where id = $1 and expires_at > now()\n returning hmac_key as \"hmac_key: HawkKey\", keys" }, "920895da4fe20ddbb0ffaaa49bc879c28a7bc5ba4bc65331632c7ba5ea1ba1f6": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Bytea" ] } }, "query": "update device\n set push_expired = true\n where device_id = $1" }, "926453dabc0466c763e22605c9845b79e1e755a395cb0dbc679cab7fc7b52c02": { "describe": { "columns": [ { "name": "?column?", "ordinal": 0, "type_info": "Int4" } ], "nullable": [ null ], "parameters": { "Left": [ "Bytea", "Bytea" ] } }, "query": "delete from user_session\n where user_id = $1 and session_id = $2\n returning 1" }, "9633dc7be0139f99b6ed0ab472620825ffe327aa2e6a81f3151c664f1f5fcacf": { "describe": { "columns": [ { "name": "uid: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "req_hmac_key: HawkKey", "ordinal": 1, "type_info": "Bytea" }, { "name": "device_id: DeviceID", "ordinal": 2, "type_info": "Bytea" }, { "name": "session_id: SessionID", "ordinal": 3, "type_info": "Bytea" }, { "name": "created_at", "ordinal": 4, "type_info": "Timestamptz" }, { "name": "verified", "ordinal": 5, "type_info": "Bool" }, { "name": "verify_code", "ordinal": 6, "type_info": "Text" } ], "nullable": [ false, false, true, false, false, false, true ], "parameters": { "Left": [ "Bytea" ] } }, "query": "update user_session\n set last_active = now()\n where session_id = (\n select session_id from oauth_token where kind = 'refresh' and id = $1\n )\n returning user_id as \"uid: UserID\", req_hmac_key as \"req_hmac_key: HawkKey\",\n device_id as \"device_id: DeviceID\", session_id as \"session_id: SessionID\",\n created_at, verified, verify_code" }, "9842eb82258490f84375f203e6bfb34127e6389b8f82c18a7be80eb20ed87cf3": { "describe": { "columns": [ { "name": "id: AvatarID", "ordinal": 0, "type_info": "Bytea" } ], "nullable": [ false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "select id as \"id: AvatarID\" from user_avatars where user_id = $1" }, "a68e2238885dba26b94ddc0534c84dd3a992c338f58ab33ef31cac5c8538dfd3": { "describe": { "columns": [ { "name": "user_id: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "client_id", "ordinal": 1, "type_info": "Text" }, { "name": "scope: ScopeSet", "ordinal": 2, "type_info": "Text" }, { "name": "access_type: OauthAccessType", "ordinal": 3, "type_info": { "Custom": { "kind": { "Enum": [ "online", "offline" ] }, "name": "oauth_access_type" } } }, { "name": "code_challenge", "ordinal": 4, "type_info": "Text" }, { "name": "keys_jwe", "ordinal": 5, "type_info": "Text" }, { "name": "auth_at", "ordinal": 6, "type_info": "Timestamptz" } ], "nullable": [ false, false, false, false, false, true, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "delete from oauth_authorization\n where id = $1 and expires_at > now()\n returning user_id as \"user_id: UserID\", client_id, scope as \"scope: ScopeSet\",\n access_type as \"access_type: OauthAccessType\",\n code_challenge, keys_jwe, auth_at" }, "ad00d5caef2f8078846c751bec410e0e2a2083f9de1ab7ede6505eca754fd145": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Bytea" ] } }, "query": "delete from oauth_token where id = $1 and kind = 'refresh'" }, "b272e9b3f4f75818993bdb73301eb117422870ec28c36e9174eab7963dcc037b": { "describe": { "columns": [ { "name": "device_id: DeviceID", "ordinal": 0, "type_info": "Bytea" }, { "name": "name", "ordinal": 1, "type_info": "Text" }, { "name": "type_", "ordinal": 2, "type_info": "Text" }, { "name": "push: DevicePush", "ordinal": 3, "type_info": { "Custom": { "kind": { "Composite": [ [ "callback", "Text" ], [ "public_key", "Text" ], [ "auth_key", "Text" ] ] }, "name": "device_push_info" } } }, { "name": "available_commands: DeviceCommands", "ordinal": 4, "type_info": { "Custom": { "kind": { "Array": { "Custom": { "kind": { "Composite": [ [ "name", "Text" ], [ "body", "Text" ] ] }, "name": "device_command" } } }, "name": "_device_command" } } }, { "name": "push_expired", "ordinal": 5, "type_info": "Bool" }, { "name": "location", "ordinal": 6, "type_info": "Jsonb" }, { "name": "last_active!", "ordinal": 7, "type_info": "Timestamptz" } ], "nullable": [ false, false, false, true, false, false, false, null ], "parameters": { "Left": [ "Bytea", "Bytea" ] } }, "query": "select d.device_id as \"device_id: DeviceID\", d.name, d.type as type_,\n d.push as \"push: DevicePush\",\n d.available_commands as \"available_commands: DeviceCommands\",\n d.push_expired, d.location, coalesce(us.last_active, to_timestamp(0)) as \"last_active!\"\n from device d left join user_session us using (device_id)\n where d.user_id = $1 and d.device_id = $2" }, "b77775fe6421918088a2ef58b1fef5fd49341b0a614a083c9d0149939a515448": { "describe": { "columns": [ { "name": "?column?", "ordinal": 0, "type_info": "Int4" } ], "nullable": [ null ], "parameters": { "Left": [ "Text" ] } }, "query": "select 1 from users where email = lower($1)" }, "bac51521196d267e983f2118939d59a3f992b1180ddeba257eab5fc3cfc4382b": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "password_change_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "hawk_key" } }, "Text" ] } }, "query": "insert into password_change_tokens (id, user_id, hmac_key, forgot_code)\n values ($1, $2, $3, $4)\n on conflict (user_id) do update set id = $1, hmac_key = $3, forgot_code = $4,\n expires_at = default" }, "c032ea41fcf2c4ac42c0fa14f1ef88a8589306888b8853b1c3aa3195b1db2f24": { "describe": { "columns": [ { "name": "id: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "auth_salt: String", "ordinal": 1, "type_info": "Text" }, { "name": "email", "ordinal": 2, "type_info": "Text" }, { "name": "ka: SecretKey", "ordinal": 3, "type_info": "Bytea" }, { "name": "wrapwrap_kb: SecretKey", "ordinal": 4, "type_info": "Bytea" }, { "name": "verify_hash: VerifyHash", "ordinal": 5, "type_info": "Bytea" }, { "name": "display_name", "ordinal": 6, "type_info": "Text" }, { "name": "verified", "ordinal": 7, "type_info": "Bool" } ], "nullable": [ false, false, false, false, false, false, true, false ], "parameters": { "Left": [ "Text" ] } }, "query": "select user_id as \"id: UserID\", auth_salt as \"auth_salt: String\", email,\n ka as \"ka: SecretKey\", wrapwrap_kb as \"wrapwrap_kb: SecretKey\",\n verify_hash as \"verify_hash: VerifyHash\", display_name, verified\n from users\n where email = lower($1)" }, "cd0c9015a7736e16fc571db03f333c7e0e57e1ea4c4d5f7eebf8eadb5e2c9b3e": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "oauth_token_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, "Text", "Text", { "Custom": { "kind": { "Domain": "Bytea" }, "name": "oauth_token_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "session_id" } }, "Timestamptz" ] } }, "query": "insert into oauth_token (id, kind, user_id, client_id, scope, session_id,\n parent_refresh, parent_session, expires_at)\n values ($1, 'access', $2, $3, $4, null, $5, $6, $7)" }, "d159085f88600222a47bb0ba50b07bcbb4076076c460a1880b13ed44fbcbeac1": { "describe": { "columns": [ { "name": "uid: UserID", "ordinal": 0, "type_info": "Bytea" }, { "name": "req_hmac_key: HawkKey", "ordinal": 1, "type_info": "Bytea" }, { "name": "device_id: DeviceID", "ordinal": 2, "type_info": "Bytea" }, { "name": "created_at", "ordinal": 3, "type_info": "Timestamptz" }, { "name": "verified", "ordinal": 4, "type_info": "Bool" }, { "name": "verify_code", "ordinal": 5, "type_info": "Text" } ], "nullable": [ false, false, true, false, false, true ], "parameters": { "Left": [ "Bytea" ] } }, "query": "update user_session\n set last_active = now()\n where session_id = $1\n returning user_id as \"uid: UserID\", req_hmac_key as \"req_hmac_key: HawkKey\",\n device_id as \"device_id: DeviceID\", created_at, verified, verify_code" }, "e70f7ba02ef7aa6caf9dc1c9ac6bf0211fc170d4ed2298d6954501360f371743": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "account_reset_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "hawk_key" } } ] } }, "query": "insert into account_reset_tokens (id, user_id, hmac_key)\n values ($1, $2, $3)\n on conflict (user_id) do update set id = $1, hmac_key = $3, expires_at = default" }, "eb7efdefa66929158d12c37e4105e9596f922abf477d27ff7d9807e572dff81b": { "describe": { "columns": [ { "name": "created_at", "ordinal": 0, "type_info": "Timestamptz" } ], "nullable": [ false ], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "session_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "hawk_key" } }, "Bool", "Text" ] } }, "query": "insert into user_session (session_id, user_id, req_hmac_key, device_id, verified,\n verify_code)\n values ($1, $2, $3, null, $4, $5)\n returning created_at" }, "ed1bbab2b586333c18c012b4fe7b7a75cf949795f8e19ca90b4869486b28f988": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ "Bytea", "Bytea" ] } }, "query": "delete from user_avatars where user_id = $1 and id = $2" }, "f27cbc16ac657f8b8e60df8e9564638a9fef007f7ef01b6d4f6dc1a7fe7a34b3": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ { "Custom": { "kind": { "Domain": "Bytea" }, "name": "oauth_token_id" } }, { "Custom": { "kind": { "Domain": "Bytea" }, "name": "user_id" } }, "Text", "Text", { "Custom": { "kind": { "Domain": "Bytea" }, "name": "session_id" } } ] } }, "query": "insert into oauth_token (id, kind, user_id, client_id, scope, session_id)\n values ($1, 'refresh', $2, $3, $4, $5)" }, "ff68e826c4762e58595b4c90180503ee38f254f848fd50d0eb97221bb50e23a0": { "describe": { "columns": [ { "name": "hmac_key: HawkKey", "ordinal": 0, "type_info": "Bytea" }, { "name": "user_id: UserID", "ordinal": 1, "type_info": "Bytea" } ], "nullable": [ false, false ], "parameters": { "Left": [ "Bytea" ] } }, "query": "delete from account_reset_tokens\n where id = $1 and expires_at > now()\n returning hmac_key as \"hmac_key: HawkKey\", user_id as \"user_id: UserID\"" } }