package hrana
import "github.com/tursodatabase/libsql-client-go/libsql/internal/hrana"
Index ¶
- type Batch
- type BatchCondition
- type BatchResult
- type BatchStep
- type Column
- type Error
- type NamedArg
- type PipelineRequest
- type PipelineResponse
- type Stmt
- func (s *Stmt) AddArgs(params shared.Params) error
- func (s *Stmt) AddNamedArgs(args map[string]any) error
- func (s *Stmt) AddPositionalArgs(args []any) error
- type StmtResult
- func (r *StmtResult) GetLastInsertRowId() int64
- func (r *StmtResult) UnmarshalJSON(data []byte) error
- type StreamRequest
- func BatchStream(sqls []string, params []shared.Params, wantRows bool, transactional bool) (*StreamRequest, error)
- func CloseStoredSqlStream(sqlId int32) StreamRequest
- func CloseStream() StreamRequest
- func ExecuteStoredStream(sqlId int32, params shared.Params, wantRows bool) (*StreamRequest, error)
- func ExecuteStream(sql string, params *shared.Params, wantRows bool) (*StreamRequest, error)
- func StoreSqlStream(sql string, sqlId int32) StreamRequest
- type StreamResponse
- func (r *StreamResponse) BatchResult() (*BatchResult, error)
- func (r *StreamResponse) ExecuteResult() (*StmtResult, error)
- type StreamResult
- type Value
Types ¶
type Batch ¶
type Batch struct { Steps []BatchStep `json:"steps"` ReplicationIndex *uint64 `json:"replication_index,omitempty"` }
func (*Batch) Add ¶
func (b *Batch) Add(stmt Stmt, condition *BatchCondition)
type BatchCondition ¶
type BatchCondition struct { Type string `json:"type"` Step *int32 `json:"step,omitempty"` Cond *BatchCondition `json:"cond,omitempty"` Conds []BatchCondition `json:"conds,omitempty"` }
type BatchResult ¶
type BatchResult struct { StepResults []*StmtResult `json:"step_results"` StepErrors []*Error `json:"step_errors"` ReplicationIndex *uint64 `json:"replication_index"` }
func (*BatchResult) UnmarshalJSON ¶
func (b *BatchResult) UnmarshalJSON(data []byte) error
type BatchStep ¶
type BatchStep struct { Stmt Stmt `json:"stmt"` Condition *BatchCondition `json:"condition,omitempty"` }
type Column ¶
type Error ¶
type NamedArg ¶
type PipelineRequest ¶
type PipelineRequest struct { Baton string `json:"baton,omitempty"` Requests []StreamRequest `json:"requests"` }
func (*PipelineRequest) Add ¶
func (pr *PipelineRequest) Add(request StreamRequest)
type PipelineResponse ¶
type PipelineResponse struct { Baton string `json:"baton,omitempty"` BaseUrl string `json:"base_url,omitempty"` Results []StreamResult `json:"results"` }
type Stmt ¶
type Stmt struct { Sql *string `json:"sql,omitempty"` SqlId *int32 `json:"sql_id,omitempty"` Args []Value `json:"args,omitempty"` NamedArgs []NamedArg `json:"named_args,omitempty"` WantRows bool `json:"want_rows"` ReplicationIndex *uint64 `json:"replication_index,omitempty"` }
func (*Stmt) AddArgs ¶
func (*Stmt) AddNamedArgs ¶
func (*Stmt) AddPositionalArgs ¶
type StmtResult ¶
type StmtResult struct { Cols []Column `json:"cols"` Rows [][]Value `json:"rows"` AffectedRowCount int32 `json:"affected_row_count"` LastInsertRowId *string `json:"last_insert_rowid"` ReplicationIndex *uint64 `json:"replication_index"` }
func (*StmtResult) GetLastInsertRowId ¶
func (r *StmtResult) GetLastInsertRowId() int64
func (*StmtResult) UnmarshalJSON ¶
func (r *StmtResult) UnmarshalJSON(data []byte) error
type StreamRequest ¶
type StreamRequest struct { Type string `json:"type"` Stmt *Stmt `json:"stmt,omitempty"` Batch *Batch `json:"batch,omitempty"` Sql *string `json:"sql,omitempty"` SqlId *int32 `json:"sql_id,omitempty"` }
func BatchStream ¶
func BatchStream(sqls []string, params []shared.Params, wantRows bool, transactional bool) (*StreamRequest, error)
func CloseStoredSqlStream ¶
func CloseStoredSqlStream(sqlId int32) StreamRequest
func CloseStream ¶
func CloseStream() StreamRequest
func ExecuteStoredStream ¶
func ExecuteStream ¶
func StoreSqlStream ¶
func StoreSqlStream(sql string, sqlId int32) StreamRequest
type StreamResponse ¶
type StreamResponse struct { Type string `json:"type"` Result json.RawMessage `json:"result,omitempty"` }
func (*StreamResponse) BatchResult ¶
func (r *StreamResponse) BatchResult() (*BatchResult, error)
func (*StreamResponse) ExecuteResult ¶
func (r *StreamResponse) ExecuteResult() (*StmtResult, error)
type StreamResult ¶
type StreamResult struct { Type string `json:"type"` Response *StreamResponse `json:"response,omitempty"` Error *Error `json:"error,omitempty"` }
type Value ¶
type Value struct { Type string `json:"type"` Value any `json:"value,omitempty"` Base64 *string `json:"base64,omitempty"` }
func ToValue ¶
func (Value) ToValue ¶
Source Files ¶
batch.go batch_result.go pipeline_request.go pipeline_response.go stmt.go stmt_result.go stream_request.go stream_result.go value.go
- Version
- v0.0.0-20240902231107-85af5b9d094d (latest)
- Published
- Sep 2, 2024
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 1 day ago –
Tools for package owners.