Compare commits
142
Commits
b1b81f60f9
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb416a9a30 | ||
|
|
5323974d4d | ||
|
|
49194f07bf | ||
|
|
2850f5c54b | ||
|
|
73616320bc | ||
|
|
33ee35ea56 | ||
|
|
623d6bae8a | ||
|
|
1d16be2137 | ||
|
|
58621b0500 | ||
|
|
bfacd2e302 | ||
|
|
455096fa37 | ||
|
|
0d1b7d1338 | ||
|
|
03d67588f5 | ||
|
|
2f51a86231 | ||
|
|
e0cd2f766e | ||
|
|
06fc8e3381 | ||
|
|
a9866654ac | ||
|
|
48496f47fc | ||
|
|
e0d0631e74 | ||
|
|
e5e7df85be | ||
|
|
0a81947aed | ||
|
|
2c2db75bd5 | ||
|
|
cf68405c44 | ||
|
|
a34fd7b7fd | ||
|
|
9771638bfc | ||
|
|
6c45bd86f4 | ||
|
|
a967b388b7 | ||
|
|
e9093d131a | ||
|
|
68cb3d5e31 | ||
|
|
ed5ac7c57d | ||
|
|
26999d690f | ||
|
|
4343959c74 | ||
|
|
f0d4a35290 | ||
|
|
51a1b85429 | ||
|
|
2b37fd6ebc | ||
|
|
6729dd060b | ||
|
|
05492123d7 | ||
|
|
a290610216 | ||
|
|
93ce76305d | ||
|
|
945ae46dbe | ||
|
|
d2993eafe0 | ||
|
|
e963947bf8 | ||
|
|
0b0c72b337 | ||
|
|
c89b76043b | ||
|
|
b40d686ef9 | ||
|
|
793f71e32e | ||
|
|
3faea141dd | ||
|
|
21f0c17af9 | ||
|
|
6ee0317186 | ||
|
|
3b5abd4177 | ||
|
|
73aff1ccd4 | ||
|
|
46a127fbf1 | ||
|
|
e0eb259182 | ||
|
|
02f29f3a99 | ||
|
|
ea165554d8 | ||
|
|
84b973794b | ||
|
|
731139045d | ||
|
|
d6bb67721e | ||
|
|
94b2f23a59 | ||
|
|
5f85713892 | ||
|
|
d584d4926b | ||
|
|
3ceb9229c1 | ||
|
|
30efddbc20 | ||
|
|
1655becf39 | ||
|
|
38ee5fe021 | ||
|
|
238c125a5c | ||
|
|
dbf6c3d9f5 | ||
|
|
1f6de34e5b | ||
|
|
7fb3abc93d | ||
|
|
18e142ec91 | ||
|
|
66984567f8 | ||
|
|
4a84c8330a | ||
|
|
0517ddd02e | ||
|
|
e68f103c29 | ||
|
|
381c229bd4 | ||
|
|
51cd5b9bd9 | ||
|
|
5c83f54a3d | ||
|
|
4a326f9584 | ||
|
|
8c0b265783 | ||
|
|
4114496b39 | ||
|
|
70bd6f48f9 | ||
|
|
7732b0ecc5 | ||
|
|
3709fcbe02 | ||
|
|
c51e9425d6 | ||
|
|
8726591528 | ||
|
|
a2ca1c60e5 | ||
|
|
8576da980e | ||
|
|
c88cfac8a0 | ||
|
|
15b229b0de | ||
|
|
d12fe3af7d | ||
|
|
ef2c299ca4 | ||
|
|
e4326831e8 | ||
|
|
85f46cb041 | ||
|
|
9038120734 | ||
|
|
1f1f027368 | ||
|
|
6f627b82ae | ||
|
|
ec46d4591b | ||
|
|
896b192c01 | ||
|
|
221c38d364 | ||
|
|
75c0ee0084 | ||
|
|
f7e3fc5342 | ||
|
|
3858dd7216 | ||
|
|
32fcec637b | ||
|
|
757903428d | ||
|
|
605276e028 | ||
|
|
9a3c03d451 | ||
|
|
e2742eee27 | ||
|
|
caa57deaad | ||
|
|
a67c67bbbd | ||
|
|
7cdd9bd74d | ||
|
|
406f30ef80 | ||
|
|
26a370aa31 | ||
|
|
d219d63dca | ||
|
|
bb58e3fd77 | ||
|
|
4e1eea5849 | ||
|
|
5f4c9bdf90 | ||
|
|
67153c79bb | ||
|
|
75ee0cb760 | ||
|
|
859ae71c51 | ||
|
|
9279258ff1 | ||
|
|
4737bd5c81 | ||
|
|
04debfba7b | ||
|
|
fd32ad706d | ||
|
|
f3f576d7df | ||
|
|
94a5acc394 | ||
|
|
37a2b7b5dc | ||
|
|
4cf6bd2f14 | ||
|
|
cce06eb025 | ||
|
|
e7062b31e4 | ||
|
|
c6efb2cd0b | ||
|
|
adf6888cc7 | ||
|
|
251f6ac3f4 | ||
|
|
e1344530c0 | ||
|
|
2015cec0f9 | ||
|
|
48979317a4 | ||
|
|
17f11deae0 | ||
|
|
ffe516d197 | ||
|
|
9e5a976ac7 | ||
|
|
18cf7e6bdd | ||
|
|
35b7c8fdf9 | ||
|
|
61d2e9ea81 | ||
|
|
87c5e4bab1 |
@@ -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
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"svelte.svelte-vscode",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
]
|
||||
}
|
||||
Vendored
+4
-1
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"editor.formatOnSave": true
|
||||
"editor.formatOnSave": true,
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss"
|
||||
}
|
||||
}
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
SERVER_DIR: "{{.TASKFILE_DIR}}/server"
|
||||
COMPOSE_CMD: docker compose -f "{{.TASKFILE_DIR}}/compose.yaml"
|
||||
DATABASE_URL: '{{.DATABASE_URL | default "postgres://expenses:expenses@127.0.0.1:5432/expenses"}}'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
cmds:
|
||||
- task --list
|
||||
|
||||
setup:
|
||||
internal: true
|
||||
cmds:
|
||||
- test -f "{{.SERVER_DIR}}/.env" || cp "{{.SERVER_DIR}}/.env.example" "{{.SERVER_DIR}}/.env"
|
||||
|
||||
db-up:
|
||||
desc: Start PostgreSQL
|
||||
cmds:
|
||||
- "{{.COMPOSE_CMD}} up -d --wait postgres"
|
||||
|
||||
db-down:
|
||||
desc: Stop PostgreSQL and remove containers
|
||||
cmds:
|
||||
- "{{.COMPOSE_CMD}} down"
|
||||
|
||||
db-logs:
|
||||
desc: Follow PostgreSQL logs
|
||||
cmds:
|
||||
- "{{.COMPOSE_CMD}} logs -f postgres"
|
||||
|
||||
db-shell:
|
||||
desc: Open a PostgreSQL shell
|
||||
cmds:
|
||||
- "{{.COMPOSE_CMD}} exec postgres psql -U expenses -d expenses"
|
||||
|
||||
db-reset:
|
||||
desc: Stop PostgreSQL and delete its data volume
|
||||
cmds:
|
||||
- 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: [setup, db-up]
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" cargo run --release --locked
|
||||
|
||||
dev:
|
||||
desc: Run the API with cargo-watch
|
||||
deps: [setup, db-up]
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" cargo watch -w src -w migrations -w Cargo.toml -w Cargo.lock -x 'run --locked'
|
||||
|
||||
migrate:
|
||||
desc: Run database migrations
|
||||
deps: [db-up]
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" SQLX_OFFLINE=false cargo sqlx migrate run
|
||||
|
||||
sqlx-prepare:
|
||||
desc: Prepare SQLx query metadata
|
||||
deps: [migrate]
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" SQLX_OFFLINE=false cargo sqlx prepare --all
|
||||
|
||||
sqlx-check:
|
||||
desc: Check SQLx query metadata
|
||||
deps: [migrate]
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && DATABASE_URL="{{.DATABASE_URL}}" SQLX_OFFLINE=false cargo sqlx prepare --check --all
|
||||
|
||||
fmt:
|
||||
desc: Format Rust code
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && cargo fmt --all
|
||||
|
||||
fmt-check:
|
||||
desc: Check Rust formatting
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && cargo fmt --all -- --check
|
||||
|
||||
check:
|
||||
desc: Run cargo check
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && SQLX_OFFLINE=true cargo check --locked
|
||||
|
||||
clippy:
|
||||
desc: Run Clippy with warnings denied
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && SQLX_OFFLINE=true cargo clippy --locked --all-targets -- -D warnings
|
||||
|
||||
test:
|
||||
desc: Run Rust tests
|
||||
cmds:
|
||||
- cd "{{.SERVER_DIR}}" && SQLX_OFFLINE=true cargo test --locked
|
||||
|
||||
ci-offline:
|
||||
desc: Run offline CI checks
|
||||
deps: [fmt-check, check, clippy, test]
|
||||
|
||||
ci:
|
||||
desc: Run the full CI checks
|
||||
deps: [sqlx-check, ci-offline]
|
||||
+5
-32
@@ -1,46 +1,19 @@
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: ./server
|
||||
dockerfile: Dockerfile
|
||||
init: true
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
RUST_LOG: trace
|
||||
HOST: 0.0.0.0
|
||||
PORT: 3000
|
||||
DATABASE_URL: postgres://expenses:expenses@postgres:5432/expenses
|
||||
SQLX_OFFLINE: "true"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- server-target:/app/target
|
||||
- ./server:/app
|
||||
networks:
|
||||
- expenses_net
|
||||
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
image: postgres:18-alpine
|
||||
environment:
|
||||
POSTGRES_DB: expenses
|
||||
POSTGRES_USER: expenses
|
||||
POSTGRES_PASSWORD: expenses
|
||||
ports:
|
||||
- 5432:5432
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U expenses -d expenses"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- expenses_net
|
||||
- postgres-data:/var/lib/postgresql
|
||||
|
||||
volumes:
|
||||
server-target:
|
||||
postgres-data:
|
||||
|
||||
networks:
|
||||
expenses_net:
|
||||
name: expenses_net
|
||||
postgres-data:
|
||||
@@ -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
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
$kind: http-request
|
||||
url: "{{base_url}}/api/auth/passkey/options"
|
||||
method: POST
|
||||
order: 1000
|
||||
+4
@@ -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
|
||||
+23
@@ -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
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
$kind: collection
|
||||
order: 3000
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
$kind: http-request
|
||||
url: "{{base_url}}/api/scheduled-transactions/00000000-0000-0000-0005-000000000001"
|
||||
method: DELETE
|
||||
settings: {}
|
||||
order: 4000
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
$kind: http-request
|
||||
url: "{{base_url}}/api/scheduled-transactions/00000000-0000-0000-0005-000000000001"
|
||||
method: GET
|
||||
settings: {}
|
||||
order: 2000
|
||||
+8
@@ -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
|
||||
+25
@@ -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
|
||||
@@ -0,0 +1,2 @@
|
||||
name: Globals
|
||||
values: []
|
||||
@@ -1,5 +0,0 @@
|
||||
/target
|
||||
.git
|
||||
.env
|
||||
.vscode
|
||||
.DS_Store
|
||||
@@ -0,0 +1,6 @@
|
||||
RUST_LOG=info
|
||||
HOST=127.0.0.1
|
||||
PORT=3000
|
||||
DATABASE_URL=postgres://expenses:expenses@localhost:5432/expenses
|
||||
ACCESS_TOKEN_LIFETIME_SECONDS=3600 # 1 hour
|
||||
REFRESH_TOKEN_LIFETIME_SECONDS=2592000 # 30 days
|
||||
+7
-2
@@ -1,3 +1,8 @@
|
||||
# Output
|
||||
/target
|
||||
.env
|
||||
.DS_Store
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
|
||||
# Env
|
||||
.env
|
||||
+137
@@ -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"
|
||||
}
|
||||
+40
@@ -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"
|
||||
}
|
||||
+93
@@ -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"
|
||||
}
|
||||
+231
@@ -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"
|
||||
}
|
||||
+41
@@ -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"
|
||||
}
|
||||
+42
@@ -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"
|
||||
}
|
||||
+138
@@ -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"
|
||||
}
|
||||
+78
@@ -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"
|
||||
}
|
||||
+89
@@ -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"
|
||||
}
|
||||
+40
@@ -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"
|
||||
}
|
||||
+31
@@ -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"
|
||||
}
|
||||
+79
@@ -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"
|
||||
}
|
||||
+89
@@ -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"
|
||||
}
|
||||
+88
@@ -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"
|
||||
}
|
||||
+120
@@ -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"
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n id,\n name,\n amount_cents,\n starts_at,\n ends_at,\n recurrence_every,\n recurrence_unit,\n weekend_adjustment\n FROM recurring_expenses\n ORDER BY starts_at DESC, id DESC\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": "starts_at",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "ends_at",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "recurrence_every",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "recurrence_unit",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "weekend_adjustment",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "546ab0f8a84d179bfc93ba646a64dd7772530e84f1adf31231c8614218c21ec4"
|
||||
}
|
||||
+41
@@ -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"
|
||||
}
|
||||
+76
@@ -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"
|
||||
}
|
||||
+54
@@ -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"
|
||||
}
|
||||
+41
@@ -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"
|
||||
}
|
||||
+141
@@ -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"
|
||||
}
|
||||
+120
@@ -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"
|
||||
}
|
||||
+40
@@ -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"
|
||||
}
|
||||
+76
@@ -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"
|
||||
}
|
||||
+79
@@ -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"
|
||||
}
|
||||
+145
@@ -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"
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT id, description, amount_cents, date\n FROM transactions\n ORDER BY date DESC, id DESC\n ",
|
||||
"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": "date",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "9b91722c2119022fa62421e2d1eaca7557b0f5a31e99485548bdd5a37b0c56fb"
|
||||
}
|
||||
+33
@@ -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"
|
||||
}
|
||||
+81
@@ -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"
|
||||
}
|
||||
+65
@@ -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"
|
||||
}
|
||||
+54
@@ -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"
|
||||
}
|
||||
+24
@@ -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"
|
||||
}
|
||||
+41
@@ -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"
|
||||
}
|
||||
+31
@@ -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"
|
||||
}
|
||||
+54
@@ -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"
|
||||
}
|
||||
+61
@@ -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"
|
||||
}
|
||||
+78
@@ -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"
|
||||
}
|
||||
+90
@@ -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"
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n a.id,\n a.user_id,\n a.user_app_id,\n a.secret_hash,\n a.expires_at,\n a.issued_at\n FROM access_tokens a\n JOIN refresh_tokens r ON r.access_token_id = a.id\n WHERE r.secret_hash = $1\n AND r.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": "e5c0bc537264fb01e0eaca622ccac4f7b0ee2940954d7e902e6952488b9cb18a"
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n UPDATE access_tokens\n SET secret_hash = $2,\n expires_at = $3,\n issued_at = $4\n WHERE secret_hash = $1\n RETURNING id, user_id, user_app_id, secret_hash, expires_at, issued_at\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",
|
||||
"Bytea",
|
||||
"Timestamptz",
|
||||
"Timestamptz"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "e9ab22c5b968148c8b1eeb03a120863e865e799bd347d84885e563e7761d2e06"
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"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 ORDER BY id\n LIMIT $3\n OFFSET $4\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",
|
||||
"Int8",
|
||||
"Int8"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "ebbb7257f06c34e3cc9bbb1c65e4e8f57a2a00c894285531f6449a47934d2f18"
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO user_apps (id, user_id)\n VALUES ($1, $2)\n ON CONFLICT (id) DO UPDATE SET\n user_id = user_apps.user_id\n WHERE user_apps.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.user_id, new_row.user_id) AS \"old_user_id!\",\n new_row.id AS \"id!\",\n new_row.user_id AS \"user_id!\"\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "old_id?",
|
||||
"type_info": "Uuid",
|
||||
"origin": {
|
||||
"Table": {
|
||||
"table": "user_apps",
|
||||
"name": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "old_user_id!",
|
||||
"type_info": "Uuid",
|
||||
"origin": "Expression"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "id!",
|
||||
"type_info": "Uuid",
|
||||
"origin": {
|
||||
"Table": {
|
||||
"table": "user_apps",
|
||||
"name": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "user_id!",
|
||||
"type_info": "Uuid",
|
||||
"origin": {
|
||||
"Table": {
|
||||
"table": "user_apps",
|
||||
"name": "user_id"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Uuid",
|
||||
"Uuid"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "ed91880a0398df14f4886a622c5432712c70187d08dea243809986a45fec4f68"
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n DELETE FROM access_tokens\n WHERE secret_hash = $1\n RETURNING id, user_id, user_app_id, secret_hash, expires_at, issued_at\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": "f052080688bdab0724707575aa61dfccde168a6ce21992c556938940f8f49b91"
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"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 AND id = $2\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": "f9df44bb80677e69ed45d496b6d5f164afa3e8932a1102eb1b0a8e8b545f3f07"
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT id, user_id\n FROM user_apps\n WHERE id = $1\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"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "fb40ed4132cb8ea06d1b0460b1be658cb1e920acbdd728f6cb12940f2cd8edef"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user