ps

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(rt *runner.Runtime)

Register installs the phpscript extensions into the runtime.

func RegisterDatabase

func RegisterDatabase(rt *runner.Runtime)

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

func NewDatabase(ctx context.Context, name string) (*Database, error)

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

func (d *Database) LastInsertId(ctx context.Context) (int64, error)

LastInsertId returns the SQLite last inserted row ID.

func (*Database) Prepare

func (d *Database) Prepare(query string) (*DatabaseStatement, error)

Prepare creates a database statement for query.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL