Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDatabase ¶
RegisterDatabase installs the Go database bridge as PS\Database.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database wraps a SQL database connection for PHP scripts.
func NewDatabase ¶
NewDatabase opens a database connection from the named DB_DSN_* env var.
func (*Database) Close ¶
func (d *Database) Close()
Close closes the underlying database connection.
func (*Database) LastInsertId ¶
LastInsertId returns the SQLite last inserted row ID.
type DatabaseStatement ¶
type DatabaseStatement struct {
// contains filtered or unexported fields
}
DatabaseStatement holds a prepared query and bound values for execution.
func (*DatabaseStatement) BindValue ¶
func (s *DatabaseStatement) BindValue(key, value any) error
BindValue binds value to a named or positional query parameter.
func (*DatabaseStatement) Close ¶
func (s *DatabaseStatement) Close() error
Close closes the active result cursor.
func (*DatabaseStatement) Execute ¶
func (s *DatabaseStatement) Execute(ctx context.Context) error
Execute runs the statement and stores the result cursor.
func (*DatabaseStatement) Fetch ¶
func (s *DatabaseStatement) Fetch() (any, error)
Fetch returns the next result row or false when no rows remain.
Click to show internal directories.
Click to hide internal directories.