Skip to content

Commit 6fee66a

Browse files
authored
Dev (#292)
* remove nodes with text content * cleanup * update filters and broken attempt at visibility updater * use naive visibility state update * try date based on variant * use role in pagination with query param to repo adapter * repo structs always exhaust lint * notes for extensible sorting * example orderbys * xo gen entity fields and filters * sorts and important notes on pagination * dont gen json for xo_tests * update * clear filter modes when filters empty * TODO - generate paginatedby exmaple * alternative xo paginated queries example * xo generic pagination update * refactor * clean * hide and show deleted entities filter * create root * login update * sorting * broken attempt at dynamic cursors * cursor should be nullable to query value dyamically * notes on ramdisk postgres for dev * cursor interface and update xo tests * nullable cursors - TODO query last or first and set automatically in repo
1 parent 5f4e0c8 commit 6fee66a

File tree

144 files changed

+11711
-4409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+11711
-4409
lines changed

bin/project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,8 @@ linters-settings:
11491149
- 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/rest\.DemoWorkItems$'
11501150
# internal/rest may need to run this, alongside all services structs
11511151
- 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql/gen/db\..*'
1152-
# - 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql/gen/db\..*CreateParams$'
1153-
- 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos\.Repos$'
1152+
# these are all adapters from service to db, so make sure they're always updated
1153+
- 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos\..*$'
11541154
exclude:
11551155
- 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql/gen/db\..*UpdateParams$'
11561156
- 'github\.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql/gen/db\..*Joins$'

cmd/cli/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616

1717
"github.com/danicc097/openapi-go-gin-postgres-sqlc/internal"
1818
"github.com/danicc097/openapi-go-gin-postgres-sqlc/internal/envvar"
19+
"github.com/danicc097/openapi-go-gin-postgres-sqlc/internal/models"
1920
"github.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql"
2021
"github.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql/gen/db"
2122
"github.com/danicc097/openapi-go-gin-postgres-sqlc/internal/utils/format"
@@ -97,7 +98,9 @@ func main() {
9798
MemberTeams: true,
9899
UserAPIKey: true,
99100
}),
100-
db.WithUserOrderBy(db.UserCreatedAtDescNullsLast))
101+
db.WithUserOrderBy(map[string]*models.Direction{
102+
"created_at": pointers.New(models.DirectionDesc),
103+
}))
101104
if err != nil {
102105
log.Fatalf("db.UserByUsername: %s\n", err)
103106
}

e2e/client/gen/model/getPaginatedUsersQueryParameters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
* openapi-go-gin-postgres-sqlc
66
* OpenAPI spec version: 2.0.0
77
*/
8+
import type { PaginationCursors } from './paginationCursors'
89
import type { PaginationItems } from './paginationItems'
910
import type { Role } from './role'
1011

1112
export interface GetPaginatedUsersQueryParameters {
13+
cursors: PaginationCursors
1214
items?: PaginationItems
1315
role?: Role
1416
}

e2e/client/gen/model/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export * from './notificationType'
8282
export * from './paginatedNotificationsResponse'
8383
export * from './paginatedUsersResponse'
8484
export * from './pagination'
85+
export * from './paginationCursor'
86+
export * from './paginationCursorValue'
87+
export * from './paginationCursors'
8588
export * from './paginationFilter'
8689
export * from './paginationFilterArray'
8790
export * from './paginationFilterArrayFilterMode'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Generated by orval v6.23.0 🍺
3+
* Do not edit manually.
4+
* OpenAPI openapi-go-gin-postgres-sqlc
5+
* openapi-go-gin-postgres-sqlc
6+
* OpenAPI spec version: 2.0.0
7+
*/
8+
import type { Direction } from './direction'
9+
import type { PaginationCursorValue } from './paginationCursorValue'
10+
11+
export interface PaginationCursor {
12+
/** represents the JSON name of the db column */
13+
column: string
14+
direction: Direction
15+
/** represents a cursor value */
16+
value: PaginationCursorValue
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Generated by orval v6.23.0 🍺
3+
* Do not edit manually.
4+
* OpenAPI openapi-go-gin-postgres-sqlc
5+
* openapi-go-gin-postgres-sqlc
6+
* OpenAPI spec version: 2.0.0
7+
*/
8+
9+
/**
10+
* represents a cursor value
11+
*/
12+
export type PaginationCursorValue = unknown | null
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Generated by orval v6.23.0 🍺
3+
* Do not edit manually.
4+
* OpenAPI openapi-go-gin-postgres-sqlc
5+
* openapi-go-gin-postgres-sqlc
6+
* OpenAPI spec version: 2.0.0
7+
*/
8+
import type { PaginationCursor } from './paginationCursor'
9+
10+
export type PaginationCursors = PaginationCursor[]

0 commit comments

Comments
 (0)