Skip to content

Commit

Permalink
feat(internal/query/conn): PrepareContext impl
Browse files Browse the repository at this point in the history
  • Loading branch information
vladDotH committed Nov 15, 2024
1 parent 29d44eb commit 2d20df5
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions internal/query/conn/driver.impls.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func (c *Conn) IsValid() bool {
}

func (c *Conn) CheckNamedValue(value *driver.NamedValue) error {
//TODO implement me
panic("implement me")
return nil
}

func (c *Conn) Ping(ctx context.Context) (finalErr error) {
Expand All @@ -56,9 +55,29 @@ func (c *Conn) Ping(ctx context.Context) (finalErr error) {
return err
}

func (c *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error) {
//TODO implement me
panic("implement me")
func (c *Conn) PrepareContext(ctx context.Context, query string) (_ driver.Stmt, finalErr error) {
if c.currentTx != nil {
return c.currentTx.PrepareContext(ctx, query)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.21.x, 23.3, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.22.x, 23.3, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.21.x, 24.1, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.22.x, 24.1, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.22.x, 24.2, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.23.x, 23.3, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.21.x, 24.2, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.23.x, 24.1, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)

Check failure on line 60 in internal/query/conn/driver.impls.go

View workflow job for this annotation

GitHub Actions / integration (1.23.x, 24.2, ubuntu)

c.currentTx.PrepareContext undefined (type currentTx has no field or method PrepareContext)
}

onDone := trace.DatabaseSQLOnConnPrepare(c.parent.Trace(), &ctx,
stack.FunctionID("github.com/ydb-platform/ydb-go-sdk/v3/internal/query/conn.(*Conn).PrepareContext"),
query,
)
defer func() {
onDone(finalErr)
}()

if !c.isReady() {
return nil, badconn.Map(xerrors.WithStackTrace(errNotReadyConn))
}

return &stmt{
conn: c,
processor: c,
ctx: ctx,
query: query,
}, nil
}

func (c *Conn) BeginTx(ctx context.Context, txOptions driver.TxOptions) (driver.Tx, error) {
Expand Down

0 comments on commit 2d20df5

Please sign in to comment.