Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.23', '1.24']
go: ['1.23', '1.24.9']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -274,6 +274,20 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
ydb:
image: ydbplatform/local-ydb:trunk
env:
GRPC_TLS_PORT: 2135
GRPC_PORT: 2136
MON_PORT: 8765
ports:
- 2136:2136
- 8765:8765
options: >-
--hostname localhost
--platform linux/amd64
--health-cmd "true"
--health-start-period 30s
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -476,6 +490,20 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
ydb:
image: ydbplatform/local-ydb:trunk
env:
GRPC_TLS_PORT: 2135
GRPC_PORT: 2136
MON_PORT: 8765
ports:
- 2136:2136
- 8765:8765
options: >-
--hostname localhost
--platform linux/amd64
--health-cmd "true"
--health-start-period 30s
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions dialect/dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const (
SQLite = "sqlite3"
Postgres = "postgres"
Gremlin = "gremlin"
YDB = "ydb"
)

// ExecQuerier wraps the 2 database operations.
Expand Down Expand Up @@ -87,6 +88,11 @@ func DebugWithContext(d Driver, logger func(context.Context, ...any)) Driver {
return drv
}

// Log returns the log function used by this DebugDriver.
func (d *DebugDriver) Log() func(context.Context, ...any) {
return d.log
}

// Exec logs its params and calls the underlying driver Exec method.
func (d *DebugDriver) Exec(ctx context.Context, query string, args, v any) error {
d.log(ctx, fmt.Sprintf("driver.Exec: query=%v args=%v", query, args))
Expand Down
6 changes: 5 additions & 1 deletion dialect/entsql/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,19 @@ type IndexAnnotation struct {
DescColumns map[string]bool

// IncludeColumns defines the INCLUDE clause for the index.
// Works only in Postgres and its definition is as follows:
// Works only in Postgres and YDB. Its definition is as follows:
//
// index.Fields("c1").
// Annotation(
// entsql.IncludeColumns("c2"),
// )
//
// Postgres:
// CREATE INDEX "table_column" ON "table"("c1") INCLUDE ("c2")
//
// YDB:
// ALTER TABLE `table` ADD INDEX `table_column` GLOBAL SYNC ON (`c1`) COVER (`c2`)
//
IncludeColumns []string

// Type defines the type of the index.
Expand Down
Loading
Loading