Documentation
¶
Overview ¶
Package sqlite provides a Starlark module for SQLite database operations.
Index ¶
- Constants
- type Module
- type OperationResult
- func (r *OperationResult) Attr(name string) (starlark.Value, error)
- func (r *OperationResult) AttrNames() []string
- func (r *OperationResult) Freeze()
- func (r *OperationResult) Hash() (uint32, error)
- func (r *OperationResult) Index(i int) starlark.Value
- func (r *OperationResult) Len() int
- func (r *OperationResult) String() string
- func (r *OperationResult) Truth() starlark.Bool
- func (r *OperationResult) Type() string
Constants ¶
const (
// ModuleName defines the expected name for this module when used in Starlark's load() function
ModuleName = "sqlite"
)
Module constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module wraps the ConfigurableModule with specific functionality for SQLite operations.
func NewModule ¶
func NewModule() *Module
NewModule creates a new module with default configuration.
func NewModuleWithFileAccess ¶
NewModuleWithFileAccess creates a new module and optionally restricts file database access.
func (*Module) LoadModule ¶
func (m *Module) LoadModule() starlet.ModuleLoader
LoadModule returns the Starlark module loader with SQLite-specific functions.
type OperationResult ¶
type OperationResult struct {
// contains filtered or unexported fields
}
OperationResult represents the result of a database operation that can either succeed with a value or fail with an error. This allows graceful error handling in Starlark scripts without causing script termination.
OperationResult implements starlark.Value, starlark.HasAttrs, and starlark.Indexable to provide a natural interface for error handling in Starlark scripts.
func (*OperationResult) Attr ¶
func (r *OperationResult) Attr(name string) (starlark.Value, error)
Attr returns the value of the specified attribute.
func (*OperationResult) AttrNames ¶
func (r *OperationResult) AttrNames() []string
AttrNames returns the list of available attributes.
func (*OperationResult) Freeze ¶
func (r *OperationResult) Freeze()
Freeze makes the OperationResult immutable (required by Starlark interface).
func (*OperationResult) Hash ¶
func (r *OperationResult) Hash() (uint32, error)
Hash returns a hash for the OperationResult (required by Starlark interface).
func (*OperationResult) Index ¶
func (r *OperationResult) Index(i int) starlark.Value
Index provides indexing support for the result value.
func (*OperationResult) Len ¶
func (r *OperationResult) Len() int
Len returns the length of the result value if it supports length operations.
func (*OperationResult) String ¶
func (r *OperationResult) String() string
String returns the string representation of the OperationResult.
func (*OperationResult) Truth ¶
func (r *OperationResult) Truth() starlark.Bool
Truth returns whether the operation was successful.
func (*OperationResult) Type ¶
func (r *OperationResult) Type() string
Type returns the Starlark type name.