feat(gl): expose ledger application and grpc operations
This commit is contained in:
@@ -18,6 +18,13 @@ type Row interface {
|
||||
Scan(dest ...any) error
|
||||
}
|
||||
|
||||
type Rows interface {
|
||||
Next() bool
|
||||
Scan(dest ...any) error
|
||||
Err() error
|
||||
Close()
|
||||
}
|
||||
|
||||
type Tx interface {
|
||||
Exec(context.Context, string, ...any) (pgconn.CommandTag, error)
|
||||
QueryRow(context.Context, string, ...any) Row
|
||||
@@ -27,7 +34,9 @@ type Tx interface {
|
||||
|
||||
type Database interface {
|
||||
Begin(context.Context) (Tx, error)
|
||||
Exec(context.Context, string, ...any) (pgconn.CommandTag, error)
|
||||
QueryRow(context.Context, string, ...any) Row
|
||||
Query(context.Context, string, ...any) (Rows, error)
|
||||
Ping(context.Context) error
|
||||
Close()
|
||||
}
|
||||
@@ -70,6 +79,14 @@ func (p *Pool) QueryRow(ctx context.Context, sql string, args ...any) Row {
|
||||
return p.pool.QueryRow(ctx, sql, args...)
|
||||
}
|
||||
|
||||
func (p *Pool) Query(ctx context.Context, sql string, args ...any) (Rows, error) {
|
||||
return p.pool.Query(ctx, sql, args...)
|
||||
}
|
||||
|
||||
func (p *Pool) Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error) {
|
||||
return p.pool.Exec(ctx, sql, args...)
|
||||
}
|
||||
|
||||
func (p *Pool) Close() {
|
||||
p.pool.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user