Compare commits

...
103 Commits
Author SHA1 Message Date
rogier fb416a9a30 Update! 2026-10-26 13:15:53 +01:00
rogier 5323974d4d Handle server authentication through fetch hook. 2026-10-26 13:14:22 +01:00
rogier 49194f07bf Cleaned up repository layer. 2026-10-26 12:31:04 +01:00
rogier 2850f5c54b Module rename. 2026-10-26 09:20:42 +01:00
rogier 73616320bc Blop. 2026-10-26 09:17:38 +01:00
rogier 33ee35ea56 Bloep. 2026-10-26 08:56:35 +01:00
rogier 623d6bae8a Fixed variable names. 2026-10-26 08:04:47 +01:00
rogier 1d16be2137 Ditches useless tests. 2026-10-25 22:18:19 +01:00
rogier 58621b0500 Basic login page. 2026-10-25 16:29:50 +01:00
rogier bfacd2e302 Log not found URI. 2026-10-25 16:06:42 +01:00
rogier 455096fa37 Load real scheduled transactions. 2026-10-25 15:34:34 +01:00
rogier 0d1b7d1338 Fixed layout height. 2026-10-24 12:57:43 +02:00
rogier 03d67588f5 Table in transaction history. 2026-10-24 12:53:54 +02:00
rogier 2f51a86231 Layout adjustment. 2026-10-24 12:49:00 +02:00
rogier e0cd2f766e Added styled check button. 2026-10-24 12:32:32 +02:00
rogier 06fc8e3381 Forgot to remove old template segment. 2026-10-24 11:24:46 +02:00
rogier a9866654ac Might be better DX. 2026-10-24 10:35:10 +02:00
rogier 48496f47fc Dynamic styling. 2026-10-24 10:31:22 +02:00
rogier e0d0631e74 Default cell rendering. 2026-10-23 22:45:32 +02:00
rogier e5e7df85be Default header rendering. 2026-10-23 22:44:14 +02:00
rogier 0a81947aed Maybe a little cleaner. 2026-10-23 22:39:26 +02:00
rogier 2c2db75bd5 Improved table logic. 2026-10-23 22:28:52 +02:00
rogier cf68405c44 Ditched component mockups. I'd like to build them myself. 2026-10-22 21:48:16 +02:00
rogier a34fd7b7fd Component mockups. 2026-10-20 22:07:11 +02:00
rogier 9771638bfc Menu bar. 2026-10-19 17:11:50 +02:00
rogier 6c45bd86f4 Svelte web app init. 2026-10-19 16:31:57 +02:00
rogier a967b388b7 Doc update. 2026-10-18 20:55:45 +02:00
rogier e9093d131a Added token repo tests. 2026-10-18 14:56:39 +02:00
rogier 68cb3d5e31 Split up files and did some consistency work. 2026-10-18 14:53:20 +02:00
rogier ed5ac7c57d More verbose, but also more consistent. 2026-10-18 14:35:34 +02:00
rogier 26999d690f Reimplemented access and refresh tokens. 2026-10-18 13:21:48 +02:00
rogier 4343959c74 Slightly more expressive expressions. 2026-10-13 12:11:13 +02:00
rogier f0d4a35290 Configure tokens (and other components) through Config structs. 2026-10-13 11:58:20 +02:00
rogier 51a1b85429 Reordered state extractors. 2026-10-12 18:19:15 +02:00
rogier 2b37fd6ebc Perform last member removal check on the database. 2026-10-12 18:05:10 +02:00
rogier 6729dd060b Added graceful shutdown. 2026-10-12 17:22:39 +02:00
rogier 05492123d7 Moved some errors around. 2026-10-12 17:18:32 +02:00
rogier a290610216 Added optional user name. 2026-10-12 17:11:38 +02:00
rogier 93ce76305d Slight polishing. 2026-10-12 14:10:19 +02:00
rogier 945ae46dbe Prepping account members for enriching user data. 2026-10-12 13:43:43 +02:00
rogier d2993eafe0 Fixed account member DTOs. 2026-10-12 13:15:07 +02:00
rogier e963947bf8 Added AppState. 2026-10-12 13:05:38 +02:00
rogier 0b0c72b337 More nit picking. 2026-10-12 12:43:21 +02:00
rogier c89b76043b Nit picking a little. 2026-10-12 12:01:26 +02:00
rogier b40d686ef9 More scoping by user ID at DB level. 2026-10-12 11:20:41 +02:00
rogier 793f71e32e Check account membership on DB level. 2026-10-11 14:03:39 +02:00
rogier 3faea141dd Made accounts and their transaction accessible to account members only. 2026-10-11 13:28:16 +02:00
rogier 21f0c17af9 Added account member API. 2026-10-11 10:00:04 +02:00
rogier 6ee0317186 Already protected by auth/existence check. 2026-10-11 09:04:25 +02:00
rogier 3b5abd4177 Ordering. 2026-10-11 08:56:45 +02:00
rogier 73aff1ccd4 PM update. 2026-10-11 08:49:47 +02:00
rogier 46a127fbf1 Full extractor responses. 2026-10-11 08:45:00 +02:00
rogier e0eb259182 Restructured client error impls. 2026-10-11 08:24:28 +02:00
rogier 02f29f3a99 Neater extractor imports. 2026-10-11 08:16:10 +02:00
rogier ea165554d8 Revert "Do force people to use auto save!"
This reverts commit 84b973794b.
2026-10-10 20:52:05 +02:00
rogier 84b973794b Do force people to use auto save! 2026-10-10 20:51:35 +02:00
rogier 731139045d Continuing with error refactoring. 2026-10-10 20:50:43 +02:00
rogier d6bb67721e This maybe a step in the right direction. 2026-10-10 17:52:24 +02:00
rogier 94b2f23a59 Struggling to clean up error handling. 2026-10-10 17:18:36 +02:00
rogier 5f85713892 Slight genericity and boundary improvement. 2026-10-10 15:54:23 +02:00
rogier d584d4926b Fixed PM token revocation. 2026-10-10 12:20:34 +02:00
rogier 3ceb9229c1 Fixed clippy warnings. 2026-10-10 12:17:15 +02:00
rogier 30efddbc20 Over engineered bearer token extraction (although it's not perfect yet). 2026-10-10 12:15:00 +02:00
rogier 1655becf39 Use Postman built-in auth flow. 2026-10-09 20:37:36 +02:00
rogier 38ee5fe021 Reference seed data by default from Postman. 2026-10-09 20:13:09 +02:00
rogier 238c125a5c Seed user apps and secrets. 2026-10-09 18:35:16 +02:00
rogier dbf6c3d9f5 Fine tuned authorization header errors. 2026-10-09 18:03:54 +02:00
rogier 1f6de34e5b Added initial authorization layer. 2026-10-09 17:22:46 +02:00
rogier 7fb3abc93d Added an authorization header bearer token extraction demo. 2026-10-09 16:46:28 +02:00
rogier 18e142ec91 These errors have become app level errors. 2026-10-09 15:28:27 +02:00
rogier 66984567f8 Standardized the upsert and delete pattern across the repo. 2026-10-09 15:09:04 +02:00
rogier 4a84c8330a Moved domain logic out of the database layer, to the user app route. 2026-10-09 14:50:39 +02:00
rogier 0517ddd02e Trace all app errors. 2026-10-09 12:24:02 +02:00
rogier e68f103c29 Added ownership and app existence validation to the user app secrets routes. 2026-10-09 12:11:42 +02:00
rogier 381c229bd4 Propagate user app ownership conflict. 2026-10-09 10:16:23 +02:00
rogier 51cd5b9bd9 Dependency upgrade. 2026-10-08 23:00:52 +02:00
rogier 5c83f54a3d Added task clean and release. 2026-10-08 22:49:35 +02:00
rogier 4a326f9584 Task run runs a release. 2026-10-08 22:39:31 +02:00
rogier 8c0b265783 This is just nit picking. 2026-10-08 22:29:41 +02:00
rogier 4114496b39 Simplified type hint. 2026-10-08 22:22:57 +02:00
rogier 70bd6f48f9 Lost refactor. 2026-10-08 22:21:01 +02:00
rogier 7732b0ecc5 Repo layer refactor. 2026-10-08 22:18:50 +02:00
rogier 3709fcbe02 Layer query simplification. 2026-10-08 21:32:44 +02:00
rogier c51e9425d6 Repo/db fn name refactor. 2026-10-08 21:18:21 +02:00
rogier 8726591528 Store secrets in PM vault. 2026-10-08 18:47:37 +02:00
Rogier Reerink a2ca1c60e5 Added a "refreshed_at" stat to tokens. 2026-10-08 16:04:53 +02:00
Rogier Reerink 8576da980e No need for query transformation gymnastics if they're only used at one place. 2026-10-08 15:43:51 +02:00
Rogier Reerink c88cfac8a0 Unified repo references. 2026-10-08 15:32:19 +02:00
Rogier Reerink 15b229b0de Do not tie tokens to a user app. 2026-10-08 15:09:06 +02:00
rogier d12fe3af7d Set bearer auth default on collection. 2026-10-08 13:42:12 +02:00
rogier ef2c299ca4 Fixed PM token refreshing. 2026-10-08 13:40:07 +02:00
rogier e4326831e8 Sync PM token variables. 2026-10-08 13:37:59 +02:00
rogier 85f46cb041 Sync Postman. 2026-10-08 13:36:08 +02:00
rogier 9038120734 Added user apps and token resources. 2026-10-07 22:50:18 +02:00
rogier 1f1f027368 Update! 2026-10-07 20:06:52 +02:00
rogier 6f627b82ae Added auth endpoint placeholders. 2026-10-03 22:43:38 +02:00
rogier ec46d4591b Updated seeds. 2026-10-03 21:41:18 +02:00
rogier 896b192c01 Refactored src and dst account to just account in preparation for a "counter party", instead of a full account. 2026-10-03 20:33:13 +02:00
rogier 221c38d364 Added initial users API. 2026-10-03 14:22:27 +02:00
rogier 75c0ee0084 Try into looks neater. 2026-09-30 09:51:30 +02:00
rogier f7e3fc5342 Test updates. 2026-09-29 22:35:03 +02:00
rogier 3858dd7216 Merge remote-tracking branch 'rogier.io/HEAD' 2026-09-29 21:46:44 +02:00
rogier 32fcec637b No need for this indirection anymore. 2026-09-29 21:45:17 +02:00
240 changed files with 12881 additions and 2271 deletions
-3
View File
@@ -1,3 +0,0 @@
/.vscode
.env
.DS_Store
+7
View File
@@ -0,0 +1,7 @@
workspace:
id: 8c2f9f37-0dc7-42c8-8376-b6c18c650d6d
cloudResources:
collections:
../postman/collections/Expenses Server: 19868969-b6a41e34-1567-4a90-af82-d863aaa2bd8e
globals:
../postman/globals/workspace.globals.yaml: 440d44c8-920a-4bc2-8fe6-de61186321be
+8
View File
@@ -0,0 +1,8 @@
{
"recommendations": [
"svelte.svelte-vscode",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss"
]
}
+6
View File
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"files.associations": {
"*.css": "tailwindcss"
}
}
+7 -2
View File
@@ -41,11 +41,16 @@ tasks:
- echo "Resetting PostgreSQL data volume..."
- "{{.COMPOSE_CMD}} down -v"
clean:
desc: Clean the API build artifacts
cmds:
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" cargo clean --locked
run:
desc: Run the API
deps: [db-up]
deps: [setup, db-up]
cmds:
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" cargo run --locked
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" cargo run --release --locked
dev:
desc: Run the API with cargo-watch
@@ -0,0 +1,51 @@
$kind: collection
variables:
- key: base_url
value: http://localhost:3000
disabled: false
- key: token_url
value: "{{base_url}}/api/auth/token"
disabled: false
- key: user_app_id
value: 00000000-0000-0000-0001-000000000001
disabled: false
- key: user_app_secret
secret: true
disabled: false
- key: access_token
secret: true
disabled: false
- key: refresh_token
secret: true
disabled: false
auth:
type: oauth2
credentials:
- key: tokenType
value: bearer
- key: token_id
value: ""
- key: accessToken
value: ""
- key: expires_in
value: 0
- key: timestamp
value: 0
- key: id
value: ""
- key: tokenName
value: expenses
- key: addTokenTo
value: header
- key: grant_type
value: client_credentials
- key: accessTokenUrl
value: "{{token_url}}"
- key: clientId
value: "{{user_app_id}}"
- key: clientSecret
value: "{{user_app_secret}}"
- key: client_authentication
value: body
- key: id
value: ""
@@ -0,0 +1,2 @@
$kind: collection
order: 4162680831488136
@@ -0,0 +1,2 @@
$kind: collection
order: 2000
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001"
method: DELETE
settings: {}
order: 4000
@@ -0,0 +1,8 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001"
method: GET
body:
type: text
content: "{}"
settings: {}
order: 2000
@@ -0,0 +1,18 @@
$kind: http-request
url: "{{base_url}}/api/accounts?name=&limit=20&offset=0"
method: GET
queryParams:
- key: name
value: ""
disabled: false
description: ""
- key: limit
value: "20"
disabled: false
description: ""
- key: offset
value: "0"
disabled: false
description: ""
settings: {}
order: 1000
@@ -0,0 +1,2 @@
$kind: collection
order: 518
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001/members/00000000-0000-0000-0006-000000000001"
method: GET
settings: {}
order: 2000
@@ -0,0 +1,14 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001/members?limit=20&offset=0"
method: GET
queryParams:
- key: limit
value: "20"
disabled: false
description: ""
- key: offset
value: "0"
disabled: false
description: ""
settings: {}
order: 1000
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001/members/00000000-0000-0000-0006-000000000001"
method: DELETE
settings: {}
order: 4000
@@ -0,0 +1,13 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001/members/00000000-0000-0000-0006-000000000001"
method: PUT
body:
type: json
content: |-
{
"user": {
"id":"00000000-0000-0000-0000-000000000001"
}
}
settings: {}
order: 3000
@@ -0,0 +1,11 @@
$kind: http-request
url: "{{base_url}}/api/accounts/00000000-0000-0000-0003-000000000001"
method: PUT
body:
type: json
content: |-
{
"name": "ASN Bank Checking"
}
settings: {}
order: 3000
@@ -0,0 +1,2 @@
$kind: collection
order: 1000
@@ -0,0 +1,2 @@
$kind: collection
order: 1000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/auth/passkey/options"
method: POST
order: 1000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/auth/passkey/verify"
method: POST
order: 2000
@@ -0,0 +1,2 @@
$kind: collection
order: 2000
@@ -0,0 +1,22 @@
$kind: http-request
url: "{{token_url}}"
method: POST
body:
type: urlencoded
content:
grant_type: refresh_token
refresh_token: "{{refresh_token}}"
auth:
type: noauth
scripts:
- type: afterResponse
code: |-
if (pm.response.code === 200) {
var access_token = pm.response.json()["access_token"];
pm.collectionVariables.set("access_token", access_token);
var refresh_token = pm.response.json()["refresh_token"];
pm.collectionVariables.set("refresh_token", refresh_token);
}
language: text/javascript
order: 2000
@@ -0,0 +1,23 @@
$kind: http-request
url: "{{token_url}}"
method: POST
body:
type: urlencoded
content:
grant_type: client_credentials
client_id: "{{user_app_id}}"
client_secret: "{{user_app_secret}}"
auth:
type: noauth
scripts:
- type: afterResponse
code: |-
if (pm.response.code === 200) {
var access_token = pm.response.json()["access_token"];
pm.collectionVariables.set("access_token", access_token);
var refresh_token = pm.response.json()["refresh_token"];
pm.collectionVariables.set("refresh_token", refresh_token);
}
language: text/javascript
order: 1000
@@ -0,0 +1,10 @@
$kind: http-request
url: "{{token_url}}/revoke"
method: POST
body:
type: urlencoded
content:
token: "{{refresh_token}}"
auth:
type: noauth
order: 3000
@@ -0,0 +1,2 @@
$kind: collection
order: 3000
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/api/scheduled-transactions/00000000-0000-0000-0005-000000000001"
method: DELETE
settings: {}
order: 4000
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/api/scheduled-transactions/00000000-0000-0000-0005-000000000001"
method: GET
settings: {}
order: 2000
@@ -0,0 +1,8 @@
$kind: http-request
url: "{{base_url}}/api/scheduled-transactions?limit=20&offset=0"
method: GET
queryParams:
limit: "20"
offset: "0"
settings: {}
order: 1000
@@ -0,0 +1,25 @@
$kind: http-request
url: "{{base_url}}/api/scheduled-transactions/00000000-0000-0000-0005-000000000001"
method: PUT
body:
type: json
content: |-
{
"type": "recurring",
"name": "DUO",
"account": {
"id": "00000000-0000-0000-0003-000000000001"
},
"amount_cents": 14000,
"direction": "out",
"schedule": {
"start": "2026-09-25T09:00:00.000Z",
"recurrence": {
"every": 4,
"unit": "week"
},
"weekend_adjustment": "previous_business_day"
}
}
settings: {}
order: 3000
@@ -0,0 +1,2 @@
$kind: collection
order: 4000
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/api/transactions/00000000-0000-0000-0004-000000000001"
method: DELETE
settings: {}
order: 4000
@@ -0,0 +1,8 @@
$kind: http-request
url: "{{base_url}}/api/transactions/00000000-0000-0000-0004-000000000001"
method: GET
body:
type: text
content: "{}"
settings: {}
order: 2000
@@ -0,0 +1,8 @@
$kind: http-request
url: "{{base_url}}/api/transactions?limit=20&offset=0"
method: GET
queryParams:
limit: "20"
offset: "0"
settings: {}
order: 1000
@@ -0,0 +1,17 @@
$kind: http-request
url: "{{base_url}}/api/transactions/00000000-0000-0000-0004-000000000001"
method: PUT
body:
type: json
content: |-
{
"description": "BBQ sauce",
"account": {
"id": "00000000-0000-0000-0003-000000000001"
},
"amount_cents": 450,
"direction": "out",
"date": "2025-10-12T16:27:00.000Z"
}
settings: {}
order: 3000
@@ -0,0 +1,2 @@
$kind: collection
order: 5000
@@ -0,0 +1,2 @@
$kind: collection
order: 1000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000003"
method: DELETE
order: 5000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000003"
method: GET
order: 3000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps"
method: GET
order: 2000
@@ -0,0 +1,2 @@
$kind: collection
order: 1000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets/00000000-0000-0000-0002-000000000001"
method: DELETE
order: 4000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets/00000000-0000-0000-0002-000000000001"
method: GET
order: 2000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets"
method: GET
order: 1000
@@ -0,0 +1,10 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000001/secrets/00000000-0000-0000-0002-000000000001"
method: PUT
body:
type: json
content: |-
{
"expires_at": "2027-01-01T00:00:00.000Z"
}
order: 3000
@@ -0,0 +1,7 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001/apps/00000000-0000-0000-0001-000000000003"
method: PUT
body:
type: json
content: "{}"
order: 4000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001"
method: DELETE
order: 5000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001"
method: GET
order: 3000
@@ -0,0 +1,4 @@
$kind: http-request
url: "{{base_url}}/api/users"
method: GET
order: 2000
@@ -0,0 +1,10 @@
$kind: http-request
url: "{{base_url}}/api/users/00000000-0000-0000-0000-000000000001"
method: PUT
body:
type: json
content: |-
{
"name": "Rocky"
}
order: 4000
@@ -0,0 +1,5 @@
$kind: http-request
url: "{{base_url}}/health"
method: GET
settings: {}
order: 4426667294982804
+2
View File
@@ -0,0 +1,2 @@
name: Globals
values: []
+3 -1
View File
@@ -1,4 +1,6 @@
RUST_LOG=info
HOST=127.0.0.1
PORT=3000
DATABASE_URL=postgres://expenses:expenses@localhost:5432/expenses
DATABASE_URL=postgres://expenses:expenses@localhost:5432/expenses
ACCESS_TOKEN_LIFETIME_SECONDS=3600 # 1 hour
REFRESH_TOKEN_LIFETIME_SECONDS=2592000 # 30 days
+8 -1
View File
@@ -1 +1,8 @@
/target
# Output
/target
# OS
.DS_Store
# Env
.env
@@ -1,28 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id, name\n\t\tFROM accounts\n\t\tWHERE id = ANY($1)\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"UuidArray"
]
},
"nullable": [
false,
false
]
},
"hash": "016dcd0136e2284546f7ad4db96cadba51847776866997f0e978cff9c869c635"
}
@@ -0,0 +1,137 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM recurring_transactions\n WHERE account_id IN (SELECT id FROM accessible_accounts($1))\n AND id = $2\n RETURNING\n id,\n name,\n account_id,\n amount_cents,\n direction,\n starts_at,\n ends_at,\n recurrence_every,\n recurrence_unit,\n weekend_adjustment\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "name"
}
}
},
{
"ordinal": 2,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "account_id"
}
}
},
{
"ordinal": 3,
"name": "amount_cents",
"type_info": "Int8",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 4,
"name": "direction",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "direction"
}
}
},
{
"ordinal": 5,
"name": "starts_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "starts_at"
}
}
},
{
"ordinal": 6,
"name": "ends_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "ends_at"
}
}
},
{
"ordinal": 7,
"name": "recurrence_every",
"type_info": "Int4",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "recurrence_every"
}
}
},
{
"ordinal": 8,
"name": "recurrence_unit",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "recurrence_unit"
}
}
},
{
"ordinal": 9,
"name": "weekend_adjustment",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "weekend_adjustment"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
true,
false,
false,
true
]
},
"hash": "030c776c90d2b5d0ea83cae5adf2b66b8636bbfcb73ef8201fafebaea5623f89"
}
@@ -0,0 +1,40 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id, name\n\t\tFROM users\n\t\tWHERE id = $1\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "users",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "users",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
true
]
},
"hash": "04663fc2c4ebe3733677026e8bd1841a0114827b8d8770c7aff2e27c99f8514b"
}
@@ -1,46 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id, description, amount_cents, direction, date\n\t\tFROM transactions\n\t\tWHERE id = $1\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "description",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "amount_cents",
"type_info": "Int8"
},
{
"ordinal": 3,
"name": "direction",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "date",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "04e8934ac1d987fc859ed21a3fdc41f62165efb6248575e78d577ca333d025c2"
}
@@ -0,0 +1,93 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tINSERT INTO access_tokens (id, user_id, user_app_id, secret_hash, expires_at, issued_at)\n\t\tVALUES ($1, $2, $3, $4, $5, $6)\n\t\tRETURNING id, user_id, user_app_id, secret_hash, expires_at, issued_at\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_id"
}
}
},
{
"ordinal": 2,
"name": "user_app_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_app_id"
}
}
},
{
"ordinal": 3,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "access_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 4,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "access_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 5,
"name": "issued_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "access_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"Bytea",
"Timestamptz",
"Timestamptz"
]
},
"nullable": [
false,
false,
true,
false,
false,
false
]
},
"hash": "0d7964d66f11a466461a5938ef1a0aa89ba9e99d8f22b06343ab27188233ec22"
}
@@ -0,0 +1,231 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO recurring_transactions (\n id,\n name,\n account_id,\n amount_cents,\n direction,\n starts_at,\n ends_at,\n recurrence_every,\n recurrence_unit,\n weekend_adjustment\n )\n SELECT $2, $3, $4, $5, $6, $7, $8, $9, $10, $11\n FROM accessible_accounts($1) AS accounts\n WHERE accounts.id = $4\n ON CONFLICT (id) DO UPDATE SET\n name = EXCLUDED.name,\n account_id = EXCLUDED.account_id,\n amount_cents = EXCLUDED.amount_cents,\n direction = EXCLUDED.direction,\n starts_at = EXCLUDED.starts_at,\n ends_at = EXCLUDED.ends_at,\n recurrence_every = EXCLUDED.recurrence_every,\n recurrence_unit = EXCLUDED.recurrence_unit,\n weekend_adjustment = EXCLUDED.weekend_adjustment\n WHERE recurring_transactions.account_id IN (SELECT id FROM accessible_accounts($1))\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.name, new_row.name) AS \"old_name!\",\n COALESCE(old_row.account_id, new_row.account_id) AS \"old_account_id!\",\n COALESCE(old_row.amount_cents, new_row.amount_cents) AS \"old_amount_cents!\",\n COALESCE(old_row.direction, new_row.direction) AS \"old_direction!\",\n COALESCE(old_row.starts_at, new_row.starts_at) AS \"old_starts_at!\",\n old_row.ends_at AS \"old_ends_at?\",\n COALESCE(old_row.recurrence_every, new_row.recurrence_every) AS \"old_recurrence_every!\",\n COALESCE(old_row.recurrence_unit, new_row.recurrence_unit) AS \"old_recurrence_unit!\",\n old_row.weekend_adjustment AS \"old_weekend_adjustment?\",\n new_row.id AS \"id!\",\n new_row.name AS \"name!\",\n new_row.account_id AS \"account_id!\",\n new_row.amount_cents AS \"amount_cents!\",\n new_row.direction AS \"direction!\",\n new_row.starts_at AS \"starts_at!\",\n new_row.ends_at AS \"ends_at?\",\n new_row.recurrence_every AS \"recurrence_every!\",\n new_row.recurrence_unit AS \"recurrence_unit!\",\n new_row.weekend_adjustment AS \"weekend_adjustment?\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_name!",
"type_info": "Text",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_account_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 3,
"name": "old_amount_cents!",
"type_info": "Int8",
"origin": "Expression"
},
{
"ordinal": 4,
"name": "old_direction!",
"type_info": "Text",
"origin": "Expression"
},
{
"ordinal": 5,
"name": "old_starts_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 6,
"name": "old_ends_at?",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "ends_at"
}
}
},
{
"ordinal": 7,
"name": "old_recurrence_every!",
"type_info": "Int4",
"origin": "Expression"
},
{
"ordinal": 8,
"name": "old_recurrence_unit!",
"type_info": "Text",
"origin": "Expression"
},
{
"ordinal": 9,
"name": "old_weekend_adjustment?",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "weekend_adjustment"
}
}
},
{
"ordinal": 10,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "id"
}
}
},
{
"ordinal": 11,
"name": "name!",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "name"
}
}
},
{
"ordinal": 12,
"name": "account_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "account_id"
}
}
},
{
"ordinal": 13,
"name": "amount_cents!",
"type_info": "Int8",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 14,
"name": "direction!",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "direction"
}
}
},
{
"ordinal": 15,
"name": "starts_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "starts_at"
}
}
},
{
"ordinal": 16,
"name": "ends_at?",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "ends_at"
}
}
},
{
"ordinal": 17,
"name": "recurrence_every!",
"type_info": "Int4",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "recurrence_every"
}
}
},
{
"ordinal": 18,
"name": "recurrence_unit!",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "recurrence_unit"
}
}
},
{
"ordinal": 19,
"name": "weekend_adjustment?",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "weekend_adjustment"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Text",
"Uuid",
"Int8",
"Text",
"Timestamptz",
"Timestamptz",
"Int4",
"Text",
"Text"
]
},
"nullable": [
false,
null,
null,
null,
null,
null,
true,
null,
null,
true,
false,
false,
false,
false,
false,
false,
true,
false,
false,
true
]
},
"hash": "129ff47c0d29ccba81eac0d40d7e9f2325911fb33b361300cd44073e1d0e3ed3"
}
@@ -0,0 +1,41 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, user_id\n FROM user_apps\n WHERE user_id = $1 AND id = $2\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_apps",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_apps",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false
]
},
"hash": "1726695ea4d8786d8e489a763cd615644f66ad541bbad08d38f4a67c86c57a37"
}
@@ -0,0 +1,42 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, user_id\n FROM user_apps\n WHERE user_id = $1\n ORDER BY id\n LIMIT $2\n OFFSET $3\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_apps",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_apps",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Int8",
"Int8"
]
},
"nullable": [
false,
false
]
},
"hash": "1eec346cce152ba824c9f49b406986014a6f0615c17e9e8a6ecd776924562b99"
}
@@ -1,22 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM recurring_transactions WHERE id = $1 RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "20f1027f06ea416d4f0d0a5b231ec8dde2291c3c49a937a8fa4612646e191420"
}
@@ -0,0 +1,138 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n name,\n account_id,\n amount_cents,\n direction,\n starts_at,\n ends_at,\n recurrence_every,\n recurrence_unit,\n weekend_adjustment\n FROM recurring_transactions\n WHERE account_id IN (SELECT id FROM accessible_accounts($1))\n ORDER BY starts_at DESC, id DESC\n LIMIT $2 OFFSET $3\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "name"
}
}
},
{
"ordinal": 2,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "account_id"
}
}
},
{
"ordinal": 3,
"name": "amount_cents",
"type_info": "Int8",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 4,
"name": "direction",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "direction"
}
}
},
{
"ordinal": 5,
"name": "starts_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "starts_at"
}
}
},
{
"ordinal": 6,
"name": "ends_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "ends_at"
}
}
},
{
"ordinal": 7,
"name": "recurrence_every",
"type_info": "Int4",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "recurrence_every"
}
}
},
{
"ordinal": 8,
"name": "recurrence_unit",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "recurrence_unit"
}
}
},
{
"ordinal": 9,
"name": "weekend_adjustment",
"type_info": "Text",
"origin": {
"Table": {
"table": "recurring_transactions",
"name": "weekend_adjustment"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Int8",
"Int8"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
true,
false,
false,
true
]
},
"hash": "216e891a0ad648d1b23a0c9ba158a26b51f67b3ef7715d2b6b0e252e7e321743"
}
@@ -0,0 +1,78 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, app_id, secret_hash, expires_at, created_at\n FROM user_app_secrets\n WHERE app_id IN (SELECT id FROM user_apps WHERE user_id = $1)\n AND app_id = $2\n AND id = $3\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "app_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "app_id"
}
}
},
{
"ordinal": 2,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "secret_hash"
}
}
},
{
"ordinal": 3,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "expires_at"
}
}
},
{
"ordinal": 4,
"name": "created_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "created_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "24ea9eccfee1ede416155c7d0fe8db417d9d3e3e8ed37b8906dcd7306fa9e241"
}
@@ -1,56 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tINSERT INTO transactions (id, description, amount_cents, direction, date)\n\t\tVALUES ($1, $2, $3, $4, $5)\n\t\tON CONFLICT (id) DO UPDATE SET\n\t\t\tdescription = EXCLUDED.description,\n\t\t\tamount_cents = EXCLUDED.amount_cents,\n\t\t\tdirection = EXCLUDED.direction,\n\t\t\tdate = EXCLUDED.date\n\t\tRETURNING WITH (OLD AS old_row, NEW AS new_row)\n\t\t\told_row.id AS \"old_id?\",\n\t\t\tnew_row.id AS \"id!\",\n\t\t\tnew_row.description AS \"description!\",\n\t\t\tnew_row.amount_cents AS \"amount_cents!\",\n\t\t\tnew_row.direction AS \"direction!\",\n\t\t\tnew_row.date AS \"date!\"\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "id!",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "description!",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "amount_cents!",
"type_info": "Int8"
},
{
"ordinal": 4,
"name": "direction!",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "date!",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Uuid",
"Text",
"Int8",
"Text",
"Timestamptz"
]
},
"nullable": [
false,
false,
false,
false,
false,
false
]
},
"hash": "2c91d06bd5687a10c8b54386586b1c5be73ae4cc1a72351a78f26c136c429e1d"
}
@@ -1,22 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM transactions WHERE id = $1 RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "3093183e1ab856c510b7a6a32c05210f18f845cb70fc3e5882dd38db4f23ec14"
}
@@ -0,0 +1,89 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, account_id, amount_cents, direction, date, description\n\t\tFROM transactions\n\t\tWHERE account_id IN (SELECT id FROM accessible_accounts($1))\n\t\t AND id = $2\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "account_id"
}
}
},
{
"ordinal": 2,
"name": "amount_cents",
"type_info": "Int8",
"origin": {
"Table": {
"table": "transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 3,
"name": "direction",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "direction"
}
}
},
{
"ordinal": 4,
"name": "date",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "transactions",
"name": "date"
}
}
},
{
"ordinal": 5,
"name": "description",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "description"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false,
false
]
},
"hash": "43bf8e81f68ec7b0e3276114f1395220f005f9e422066a62343daf9603dd921e"
}
@@ -0,0 +1,40 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id, name\n\t\tFROM users\n\t\tWHERE id = ANY($1)\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "users",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "users",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"UuidArray"
]
},
"nullable": [
false,
true
]
},
"hash": "443bee847f228636f13fc85b764166a05053329fca285195c109dbfc34784a78"
}
@@ -0,0 +1,31 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id AS \"id!\", name AS \"name!\"\n\t\tFROM accessible_accounts($1)\n\t\tWHERE id = $2\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 1,
"name": "name!",
"type_info": "Text",
"origin": "Expression"
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
null,
null
]
},
"hash": "4ab020caa34fd1b6a1479e2da759d26ad6c944ca01992430ba03c21cbe0764e0"
}
@@ -0,0 +1,79 @@
{
"db_name": "PostgreSQL",
"query": "\n UPDATE refresh_tokens\n SET secret_hash = $2,\n expires_at = $3,\n issued_at = $4\n WHERE secret_hash = $1\n RETURNING id, access_token_id, secret_hash, expires_at, issued_at\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "access_token_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "access_token_id"
}
}
},
{
"ordinal": 2,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 3,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 4,
"name": "issued_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Bytea",
"Bytea",
"Timestamptz",
"Timestamptz"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "4b8559a53ceed6a384e287d52dcb67edcae1bb076099c81637f2b882637419b7"
}
@@ -0,0 +1,89 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM transactions\n WHERE account_id IN (SELECT id FROM accessible_accounts($1))\n AND id = $2\n RETURNING id, account_id, amount_cents, direction, date, description\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "account_id"
}
}
},
{
"ordinal": 2,
"name": "amount_cents",
"type_info": "Int8",
"origin": {
"Table": {
"table": "transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 3,
"name": "direction",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "direction"
}
}
},
{
"ordinal": 4,
"name": "date",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "transactions",
"name": "date"
}
}
},
{
"ordinal": 5,
"name": "description",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "description"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false,
false
]
},
"hash": "4d348877f9b1058c5f22c64379476276bc40da2f1fda506e3de1bfac51947cde"
}
@@ -0,0 +1,88 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n user_id,\n user_app_id,\n secret_hash,\n expires_at,\n issued_at\n FROM access_tokens\n WHERE secret_hash = $1\n AND expires_at > now()\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_id"
}
}
},
{
"ordinal": 2,
"name": "user_app_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_app_id"
}
}
},
{
"ordinal": 3,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "access_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 4,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "access_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 5,
"name": "issued_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "access_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Bytea"
]
},
"nullable": [
false,
false,
true,
false,
false,
false
]
},
"hash": "50a9f81495657e35bedbf7fa3107f63c401aea690fdae95d74d03d86bdaa2a56"
}
@@ -0,0 +1,120 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO refresh_tokens (id, access_token_id, secret_hash, expires_at, issued_at)\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (id) DO UPDATE SET\n secret_hash = refresh_tokens.secret_hash,\n expires_at = refresh_tokens.expires_at,\n issued_at = refresh_tokens.issued_at\n WHERE refresh_tokens.access_token_id = EXCLUDED.access_token_id\n AND refresh_tokens.secret_hash <> EXCLUDED.secret_hash\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.access_token_id, new_row.access_token_id) AS \"old_access_token_id!\",\n COALESCE(old_row.secret_hash, new_row.secret_hash) AS \"old_secret_hash!\",\n COALESCE(old_row.expires_at, new_row.expires_at) AS \"old_expires_at!\",\n COALESCE(old_row.issued_at, new_row.issued_at) AS \"old_issued_at!\",\n new_row.id AS \"id!\",\n new_row.access_token_id AS \"access_token_id!\",\n new_row.secret_hash AS \"secret_hash!\",\n new_row.expires_at AS \"expires_at!\",\n new_row.issued_at AS \"issued_at!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_access_token_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_secret_hash!",
"type_info": "Bytea",
"origin": "Expression"
},
{
"ordinal": 3,
"name": "old_expires_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 4,
"name": "old_issued_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 5,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "id"
}
}
},
{
"ordinal": 6,
"name": "access_token_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "access_token_id"
}
}
},
{
"ordinal": 7,
"name": "secret_hash!",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 8,
"name": "expires_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 9,
"name": "issued_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Bytea",
"Timestamptz",
"Timestamptz"
]
},
"nullable": [
false,
null,
null,
null,
null,
false,
false,
false,
false,
false
]
},
"hash": "5320efb1916efecdeb9f0b5d199d7e7d13d6df53399de9c062d0fab3ea17d224"
}
@@ -0,0 +1,41 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id, name\n\t\tFROM users\n\t\tORDER BY id DESC\n\t\tLIMIT $1\n\t\tOFFSET $2\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "users",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "users",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Int8",
"Int8"
]
},
"nullable": [
false,
true
]
},
"hash": "56081e68b4709f6a2bb4b54c8a173c235e744ccb30e2eb1b9fa3b8cd47386268"
}
@@ -0,0 +1,76 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM refresh_tokens\n WHERE secret_hash = $1\n RETURNING id, access_token_id, secret_hash, expires_at, issued_at\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "access_token_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "access_token_id"
}
}
},
{
"ordinal": 2,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 3,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 4,
"name": "issued_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Bytea"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "6262f385b10112a7d3cc98121c8ba104132c065ac1c1522c3dd80b4284faf1a1"
}
@@ -0,0 +1,54 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM account_members\n WHERE account_id IN (SELECT id FROM accessible_accounts($1))\n AND account_id = $2\n AND id = $3\n RETURNING id, account_id, user_id\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "account_id"
}
}
},
{
"ordinal": 2,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "627f0b5cca9c9a70441454f5ba0cd45d2c6e306737febc7f3a0c2e73148ade76"
}
@@ -0,0 +1,41 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM user_apps\n WHERE user_id = $1 AND id = $2\n RETURNING id, user_id\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_apps",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_apps",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false
]
},
"hash": "635bccdb4faf5dede694bb6ad51e7894a1641ea6c37f2abe230de264715e2390"
}
@@ -0,0 +1,141 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO transactions (id, account_id, amount_cents, direction, date, description)\n SELECT $2, $3, $4, $5, $6, $7\n FROM accessible_accounts($1) AS accounts\n WHERE accounts.id = $3\n ON CONFLICT (id) DO UPDATE SET\n account_id = EXCLUDED.account_id,\n amount_cents = EXCLUDED.amount_cents,\n direction = EXCLUDED.direction,\n date = EXCLUDED.date,\n description = EXCLUDED.description\n WHERE transactions.account_id IN (SELECT id FROM accessible_accounts($1))\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.account_id, new_row.account_id) AS \"old_account_id!\",\n COALESCE(old_row.amount_cents, new_row.amount_cents) AS \"old_amount_cents!\",\n COALESCE(old_row.direction, new_row.direction) AS \"old_direction!\",\n COALESCE(old_row.date, new_row.date) AS \"old_date!\",\n COALESCE(old_row.description, new_row.description) AS \"old_description!\",\n new_row.id AS \"id!\",\n new_row.account_id AS \"account_id!\",\n new_row.amount_cents AS \"amount_cents!\",\n new_row.direction AS \"direction!\",\n new_row.date AS \"date!\",\n new_row.description AS \"description!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_account_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_amount_cents!",
"type_info": "Int8",
"origin": "Expression"
},
{
"ordinal": 3,
"name": "old_direction!",
"type_info": "Text",
"origin": "Expression"
},
{
"ordinal": 4,
"name": "old_date!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 5,
"name": "old_description!",
"type_info": "Text",
"origin": "Expression"
},
{
"ordinal": 6,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "id"
}
}
},
{
"ordinal": 7,
"name": "account_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "account_id"
}
}
},
{
"ordinal": 8,
"name": "amount_cents!",
"type_info": "Int8",
"origin": {
"Table": {
"table": "transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 9,
"name": "direction!",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "direction"
}
}
},
{
"ordinal": 10,
"name": "date!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "transactions",
"name": "date"
}
}
},
{
"ordinal": 11,
"name": "description!",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "description"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"Int8",
"Text",
"Timestamptz",
"Text"
]
},
"nullable": [
false,
null,
null,
null,
null,
null,
false,
false,
false,
false,
false,
false
]
},
"hash": "644b5254e749e03696892b2234c1e8feee5d852e443c4fe0c1c71cdddfab3f6e"
}
@@ -0,0 +1,120 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO user_app_secrets (id, app_id, secret_hash, expires_at)\n SELECT $2, $3, $4, $5\n FROM user_apps\n WHERE user_id = $1 AND id = $3\n FOR KEY SHARE\n ON CONFLICT (id, app_id) DO UPDATE SET\n secret_hash = EXCLUDED.secret_hash,\n expires_at = EXCLUDED.expires_at\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.app_id, new_row.app_id) AS \"old_app_id!\",\n COALESCE(old_row.secret_hash, new_row.secret_hash) AS \"old_secret_hash!\",\n COALESCE(old_row.expires_at, new_row.expires_at) AS \"old_expires_at!\",\n COALESCE(old_row.created_at, new_row.created_at) AS \"old_created_at!\",\n new_row.id AS \"id!\",\n new_row.app_id AS \"app_id!\",\n new_row.secret_hash AS \"secret_hash!\",\n new_row.expires_at AS \"expires_at!\",\n new_row.created_at AS \"created_at!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_app_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_secret_hash!",
"type_info": "Bytea",
"origin": "Expression"
},
{
"ordinal": 3,
"name": "old_expires_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 4,
"name": "old_created_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 5,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 6,
"name": "app_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "app_id"
}
}
},
{
"ordinal": 7,
"name": "secret_hash!",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "secret_hash"
}
}
},
{
"ordinal": 8,
"name": "expires_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "expires_at"
}
}
},
{
"ordinal": 9,
"name": "created_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "created_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"Bytea",
"Timestamptz"
]
},
"nullable": [
false,
null,
null,
null,
null,
false,
false,
false,
false,
false
]
},
"hash": "6e94a9a8c3d5f266a8e53b99c6d9af63b87d279c09b1c484315eea1cd3e08459"
}
@@ -0,0 +1,40 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM users\n WHERE id = $1\n RETURNING id, name\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "users",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "users",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
true
]
},
"hash": "7c3bb75adeb8e2eb29970d21bf8a2b6a5d5440a758503ef1bcdd74fcf6315d99"
}
@@ -0,0 +1,76 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n access_token_id,\n secret_hash,\n expires_at,\n issued_at\n FROM refresh_tokens\n WHERE secret_hash = $1\n AND expires_at > now()\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "access_token_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "access_token_id"
}
}
},
{
"ordinal": 2,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 3,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 4,
"name": "issued_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "refresh_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Bytea"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "8a5728429d71470fc276d2572f9b36d316eca63173b1463d5b3bed3e08d7ab19"
}
@@ -0,0 +1,79 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, app_id, secret_hash, expires_at, created_at\n FROM user_app_secrets\n WHERE app_id IN (SELECT id FROM user_apps WHERE user_id = $1)\n AND app_id = $2\n ORDER BY created_at DESC, id DESC\n LIMIT $3\n OFFSET $4\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "app_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "app_id"
}
}
},
{
"ordinal": 2,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "secret_hash"
}
}
},
{
"ordinal": 3,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "expires_at"
}
}
},
{
"ordinal": 4,
"name": "created_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "created_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Int8",
"Int8"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "9427a4738d4658bb38141bdd6d6a0140ff8585b90ac6cb85e27401f87d572f2d"
}
@@ -0,0 +1,145 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO access_tokens (id, user_id, user_app_id, secret_hash, expires_at, issued_at)\n VALUES ($1, $2, $3, $4, $5, $6)\n ON CONFLICT (id) DO UPDATE SET\n secret_hash = access_tokens.secret_hash,\n expires_at = access_tokens.expires_at,\n issued_at = access_tokens.issued_at\n WHERE access_tokens.user_id = EXCLUDED.user_id\n AND access_tokens.user_app_id IS NOT DISTINCT FROM EXCLUDED.user_app_id\n AND access_tokens.secret_hash <> EXCLUDED.secret_hash\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.user_id, new_row.user_id) AS \"old_user_id!\",\n old_row.user_app_id AS \"old_user_app_id?\",\n COALESCE(old_row.secret_hash, new_row.secret_hash) AS \"old_secret_hash!\",\n COALESCE(old_row.expires_at, new_row.expires_at) AS \"old_expires_at!\",\n COALESCE(old_row.issued_at, new_row.issued_at) AS \"old_issued_at!\",\n new_row.id AS \"id!\",\n new_row.user_id AS \"user_id!\",\n new_row.user_app_id AS \"user_app_id?\",\n new_row.secret_hash AS \"secret_hash!\",\n new_row.expires_at AS \"expires_at!\",\n new_row.issued_at AS \"issued_at!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_user_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_user_app_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_app_id"
}
}
},
{
"ordinal": 3,
"name": "old_secret_hash!",
"type_info": "Bytea",
"origin": "Expression"
},
{
"ordinal": 4,
"name": "old_expires_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 5,
"name": "old_issued_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 6,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "id"
}
}
},
{
"ordinal": 7,
"name": "user_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_id"
}
}
},
{
"ordinal": 8,
"name": "user_app_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "access_tokens",
"name": "user_app_id"
}
}
},
{
"ordinal": 9,
"name": "secret_hash!",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "access_tokens",
"name": "secret_hash"
}
}
},
{
"ordinal": 10,
"name": "expires_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "access_tokens",
"name": "expires_at"
}
}
},
{
"ordinal": 11,
"name": "issued_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "access_tokens",
"name": "issued_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"Bytea",
"Timestamptz",
"Timestamptz"
]
},
"nullable": [
false,
null,
true,
null,
null,
null,
false,
false,
true,
false,
false,
false
]
},
"hash": "952c2e15628f93a5d08cd2ebd0510443d21644fdbc878069eda6959677b220ec"
}
@@ -1,30 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id, name\n\t\tFROM accounts\n\t\tWHERE ($1::text IS NULL OR name ILIKE '%' || $1 || '%')\n\t\tORDER BY name DESC, id DESC\n\t\tLIMIT $2\n\t\tOFFSET $3\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text",
"Int8",
"Int8"
]
},
"nullable": [
false,
false
]
},
"hash": "9b5267c3bd09fb64717565c5c7e3084195d09c0a30f7e963a2497892398c6adc"
}
@@ -0,0 +1,33 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id AS \"id!\", name AS \"name!\"\n\t\tFROM accessible_accounts($1)\n\t\tWHERE ($2::text IS NULL OR name ILIKE '%' || $2 || '%')\n\t\tORDER BY name DESC, id DESC\n\t\tLIMIT $3\n\t\tOFFSET $4\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 1,
"name": "name!",
"type_info": "Text",
"origin": "Expression"
}
],
"parameters": {
"Left": [
"Uuid",
"Text",
"Int8",
"Int8"
]
},
"nullable": [
null,
null
]
},
"hash": "9d072194b9f245f29ec5d97b3363e7a9b069cf38ed1fecdb739b85715cba26ca"
}
@@ -0,0 +1,81 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO account_members (id, account_id, user_id)\n SELECT $2, $3, $4\n FROM accessible_accounts($1) AS accounts\n WHERE accounts.id = $3\n ON CONFLICT (id, account_id) DO UPDATE SET\n user_id = EXCLUDED.user_id\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.account_id, new_row.account_id) AS \"old_account_id!\",\n COALESCE(old_row.user_id, new_row.user_id) AS \"old_user_id!\",\n new_row.id AS \"id!\",\n new_row.account_id AS \"account_id!\",\n new_row.user_id AS \"user_id!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_account_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_user_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 3,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "id"
}
}
},
{
"ordinal": 4,
"name": "account_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "account_id"
}
}
},
{
"ordinal": 5,
"name": "user_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
null,
null,
false,
false,
false
]
},
"hash": "9de36a6a53617c842abadaee6e54796d3c632e5b11d001de507b9039664fce38"
}
@@ -0,0 +1,65 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tINSERT INTO users (id, name)\n\t\tVALUES ($1, $2)\n\t\tON CONFLICT (id) DO UPDATE SET\n name = EXCLUDED.name\n\t\tRETURNING WITH (OLD AS old_row, NEW AS new_row)\n\t\t\told_row.id AS \"old_id?\",\n\t\t\told_row.name AS \"old_name?\",\n\t\t\tnew_row.id AS \"id!\",\n\t\t\tnew_row.name AS \"name?\"\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "users",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_name?",
"type_info": "Text",
"origin": {
"Table": {
"table": "users",
"name": "name"
}
}
},
{
"ordinal": 2,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "users",
"name": "id"
}
}
},
{
"ordinal": 3,
"name": "name?",
"type_info": "Text",
"origin": {
"Table": {
"table": "users",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Text"
]
},
"nullable": [
false,
true,
false,
true
]
},
"hash": "a185e03615a65324b1fbf9c97213a1e949353589679fd5689f88af14b3dda682"
}
@@ -0,0 +1,54 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO account_members (id, account_id, user_id)\n VALUES ($1, $2, $3)\n RETURNING id, account_id, user_id\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "account_id"
}
}
},
{
"ordinal": 2,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "a39efb08903f954f52d1f70d8f8cbc4450ff9c1e11f9d6be51a6b29b7f35594e"
}
@@ -0,0 +1,24 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT EXISTS (\n SELECT 1\n FROM user_app_secrets\n WHERE app_id = $1 AND secret_hash = $2 AND expires_at > now()\n ) AS \"is_valid!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "is_valid!",
"type_info": "Bool",
"origin": "Expression"
}
],
"parameters": {
"Left": [
"Uuid",
"Bytea"
]
},
"nullable": [
null
]
},
"hash": "a49a3149600f1ad83c82aee5910949e895611df56fb0c07a54b2536b6a3a6329"
}
@@ -1,83 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n name,\n amount_cents,\n direction,\n source_account_id,\n destination_account_id,\n starts_at,\n ends_at,\n recurrence_every,\n recurrence_unit,\n weekend_adjustment\n FROM recurring_transactions\n ORDER BY starts_at DESC, id DESC\n LIMIT $1 OFFSET $2\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "amount_cents",
"type_info": "Int8"
},
{
"ordinal": 3,
"name": "direction",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "source_account_id",
"type_info": "Uuid"
},
{
"ordinal": 5,
"name": "destination_account_id",
"type_info": "Uuid"
},
{
"ordinal": 6,
"name": "starts_at",
"type_info": "Timestamptz"
},
{
"ordinal": 7,
"name": "ends_at",
"type_info": "Timestamptz"
},
{
"ordinal": 8,
"name": "recurrence_every",
"type_info": "Int4"
},
{
"ordinal": 9,
"name": "recurrence_unit",
"type_info": "Text"
},
{
"ordinal": 10,
"name": "weekend_adjustment",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Int8",
"Int8"
]
},
"nullable": [
false,
false,
false,
false,
true,
true,
false,
true,
false,
false,
true
]
},
"hash": "a67033cd73e269ec203817b402ef40647a1965dca8419e6aa9d33a5dfa9e5426"
}
@@ -0,0 +1,41 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tDELETE FROM accounts\n\t\tWHERE id IN (SELECT id FROM accessible_accounts($1))\n\t\t AND id = $2\n\t\tRETURNING id, name\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "accounts",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text",
"origin": {
"Table": {
"table": "accounts",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false
]
},
"hash": "a8df8db87ec64af8ce5767483095f3fbfc34ed1551e0bc722629335609299cd6"
}
@@ -1,35 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tINSERT INTO accounts (id, name)\n\t\tVALUES ($1, $2)\n\t\tON CONFLICT (id) DO UPDATE SET\n\t\t\tname = EXCLUDED.name\n\t\tRETURNING WITH (OLD AS old_row, NEW AS new_row)\n\t\t\told_row.id AS \"old_id?\",\n\t\t\tnew_row.id AS \"id!\",\n\t\t\tnew_row.name AS \"name!\"\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "id!",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "name!",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Uuid",
"Text"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "ab6330c86c647fc7b8085152087066269b95eab3d60ad9d97219e93686a85a55"
}
@@ -1,22 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM accounts WHERE id = $1 RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "b755bf49d60419830ddaf5855268dd31e1f82bef6b4fd0046a4c5cbffb3e877a"
}
@@ -0,0 +1,31 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tSELECT id AS \"id!\", name AS \"name!\"\n\t\tFROM accessible_accounts($1)\n\t\tWHERE id = ANY($2)\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 1,
"name": "name!",
"type_info": "Text",
"origin": "Expression"
}
],
"parameters": {
"Left": [
"Uuid",
"UuidArray"
]
},
"nullable": [
null,
null
]
},
"hash": "b83902d6b3ccb3163c88ba684663a6774dd446a3dbd5301513e9f64cda75a325"
}
@@ -0,0 +1,54 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, account_id, user_id\n FROM account_members\n WHERE account_id IN (SELECT id FROM accessible_accounts($1))\n AND account_id = $2\n AND id = $3\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "account_id"
}
}
},
{
"ordinal": 2,
"name": "user_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "account_members",
"name": "user_id"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "bda4a0c1d3a770cb99f5d08970b56fc0b492aac6b909a9ae4577f401b53abc98"
}
@@ -0,0 +1,61 @@
{
"db_name": "PostgreSQL",
"query": "\n\t\tINSERT INTO accounts (id, name)\n\t\tVALUES ($2, $3)\n\t\tON CONFLICT (id) DO UPDATE SET\n\t\t\tname = EXCLUDED.name\n\t\tWHERE accounts.id IN (SELECT id FROM accessible_accounts($1))\n\t\tRETURNING WITH (OLD AS old_row, NEW AS new_row)\n\t\t\told_row.id AS \"old_id?\",\n\t\t\tCOALESCE(old_row.name, new_row.name) AS \"old_name!\",\n\t\t\tnew_row.id AS \"id!\",\n\t\t\tnew_row.name AS \"name!\"\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "accounts",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_name!",
"type_info": "Text",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "accounts",
"name": "id"
}
}
},
{
"ordinal": 3,
"name": "name!",
"type_info": "Text",
"origin": {
"Table": {
"table": "accounts",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Text"
]
},
"nullable": [
false,
null,
false,
false
]
},
"hash": "c5a2016942aadfafee38e7b4ad2926684d3d846a36d99bc0b33a48ae8a3076a9"
}
@@ -0,0 +1,78 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM user_app_secrets\n WHERE app_id IN (SELECT id FROM user_apps WHERE user_id = $1)\n AND app_id = $2\n AND id = $3\n RETURNING id, app_id, secret_hash, expires_at, created_at\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "app_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "app_id"
}
}
},
{
"ordinal": 2,
"name": "secret_hash",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "secret_hash"
}
}
},
{
"ordinal": 3,
"name": "expires_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "expires_at"
}
}
},
{
"ordinal": 4,
"name": "created_at",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "created_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "c63f403f24c69c83483086a382840714b4361d017a3b7d18be094609cba65074"
}
@@ -1,98 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO recurring_transactions (\n id,\n name,\n amount_cents,\n direction,\n source_account_id,\n destination_account_id,\n starts_at,\n ends_at,\n recurrence_every,\n recurrence_unit,\n weekend_adjustment\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)\n ON CONFLICT (id) DO UPDATE SET\n name = EXCLUDED.name,\n amount_cents = EXCLUDED.amount_cents,\n direction = EXCLUDED.direction,\n source_account_id = EXCLUDED.source_account_id,\n destination_account_id = EXCLUDED.destination_account_id,\n starts_at = EXCLUDED.starts_at,\n ends_at = EXCLUDED.ends_at,\n recurrence_every = EXCLUDED.recurrence_every,\n recurrence_unit = EXCLUDED.recurrence_unit,\n weekend_adjustment = EXCLUDED.weekend_adjustment\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n new_row.id AS \"id!\",\n new_row.name AS \"name!\",\n new_row.amount_cents AS \"amount_cents!\",\n new_row.direction AS \"direction!\",\n new_row.source_account_id AS \"source_account_id?\",\n new_row.destination_account_id AS \"destination_account_id?\",\n new_row.starts_at AS \"starts_at!\",\n new_row.ends_at AS \"ends_at?\",\n new_row.recurrence_every AS \"recurrence_every!\",\n new_row.recurrence_unit AS \"recurrence_unit!\",\n new_row.weekend_adjustment AS \"weekend_adjustment?\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "id!",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "name!",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "amount_cents!",
"type_info": "Int8"
},
{
"ordinal": 4,
"name": "direction!",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "source_account_id?",
"type_info": "Uuid"
},
{
"ordinal": 6,
"name": "destination_account_id?",
"type_info": "Uuid"
},
{
"ordinal": 7,
"name": "starts_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 8,
"name": "ends_at?",
"type_info": "Timestamptz"
},
{
"ordinal": 9,
"name": "recurrence_every!",
"type_info": "Int4"
},
{
"ordinal": 10,
"name": "recurrence_unit!",
"type_info": "Text"
},
{
"ordinal": 11,
"name": "weekend_adjustment?",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Uuid",
"Text",
"Int8",
"Text",
"Uuid",
"Uuid",
"Timestamptz",
"Timestamptz",
"Int4",
"Text",
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
true,
true,
false,
true,
false,
false,
true
]
},
"hash": "cd3573646e7cfe523b7dc97092134f22568eb9288e8d56522bdfbbc2aab43fb4"
}
@@ -0,0 +1,90 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, account_id, amount_cents, direction, date, description\n\t\tFROM transactions\n\t\tWHERE account_id IN (SELECT id FROM accessible_accounts($1))\n\t\tORDER BY date DESC, id DESC\n\t\tLIMIT $2\n\t\tOFFSET $3\n\t\t",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "account_id",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "transactions",
"name": "account_id"
}
}
},
{
"ordinal": 2,
"name": "amount_cents",
"type_info": "Int8",
"origin": {
"Table": {
"table": "transactions",
"name": "amount_cents"
}
}
},
{
"ordinal": 3,
"name": "direction",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "direction"
}
}
},
{
"ordinal": 4,
"name": "date",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "transactions",
"name": "date"
}
}
},
{
"ordinal": 5,
"name": "description",
"type_info": "Text",
"origin": {
"Table": {
"table": "transactions",
"name": "description"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Int8",
"Int8"
]
},
"nullable": [
false,
false,
false,
false,
false,
false
]
},
"hash": "d4a872e24aaff164619557665960013cf838d38e407ef5730a26dfe00a0dd96b"
}

Some files were not shown because too many files have changed in this diff Show More