Documentation
¶
Overview ¶
Package store persists prefetched on-chain data to a local SQLite database.
Index ¶
- func ValidateSQL(query string) error
- type DB
- func (s *DB) Close() error
- func (s *DB) DB() *sql.DB
- func (s *DB) FilePath() string
- func (d *DB) Query(ctx context.Context, query string, args []any) ([]map[string]any, error)
- func (s *DB) Raw() *sql.DB
- func (s *DB) Schema(ctx context.Context) (string, error)
- func (s *DB) WriteRaydiumAmm(list []*raydiumamm.Summary) error
- func (s *DB) WriteRaydiumClmm(list map[sgo.PublicKey]*clmm.Amm) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps a SQLite connection and owns the schema lifecycle.
func Open ¶
Open opens (or creates) the SQLite database at path and applies the Raydium schema.
func (*DB) DB ¶
DB returns the underlying *sql.DB for passing directly to sub-packages.
func (*DB) FilePath ¶
DB returns the underlying *sql.DB for passing directly to sub-packages.
func (*DB) Query ¶
Query runs a caller-supplied, read-only SQL statement against the database and returns each row as a column-name-keyed map. ValidateSQL gates this to SELECT-only (no INSERT/UPDATE/DELETE/DDL/etc.) since, unlike every other method on DB, the query string itself is not a fixed literal in this codebase -- see e.g. the pnl agent's text-to-SQL node, which hands this a model-generated query.
func (*DB) Raw ¶
Raw exposes the underlying *sql.DB for packages under prefetch/ whose store functions operate on a raw connection rather than this wrapper (e.g. perpfunding.SetTargetAllocation).
func (*DB) WriteRaydiumAmm ¶
func (s *DB) WriteRaydiumAmm(list []*raydiumamm.Summary) error
WriteRaydiumAmm upserts all AMM v4 pool summaries. Summary carries only vault pubkeys and balances; fee/market fields are omitted because AMM full-download is currently disabled in raydium.Create.
Source Files
¶
- db.go
- raydium.go