firestore

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DocIDColumn = "id"

Variables

This section is empty.

Functions

func AddDocIDToResults added in v0.1.1

func AddDocIDToResults(selectStmt *query.Select, results []map[string]interface{})

AddDocIDToResults adds document ID to query results

func FindDocIDInWhere added in v0.1.1

func FindDocIDInWhere(qualify *expr.Qualify, args []interface{}) (string, bool, error)

FindDocIDInWhere extracts document ID from WHERE docid = 'value' clause

func FindDocIDValueInInsert added in v0.1.1

func FindDocIDValueInInsert(insertStmt *insert.Statement, args []interface{}) (string, bool, error)

FindDocIDValueInInsert finds the document ID value in the INSERT statement values

func HasDocIDInColumns added in v0.1.1

func HasDocIDInColumns(columns []string) bool

HasDocIDInColumns checks if the document ID column is present in the column list

func IsDocIDColumn added in v0.1.1

func IsDocIDColumn(columnName string) bool

IsDocIDColumn checks if a column name is the document ID column

Types

type Config

type Config struct {
	CredentialsFile string // Username
	Endpoint        string
	APIKey          string
	CredentialJSON  []byte
	CredentialsURL  string
	CredID          string //scy secret resource ID
	CredentialsKey  string
	UserAgent       string
	ProjectID       string // project ID
	QuotaProject    string
	Scopes          []string
	Location        string
	App             string
	url.Values
}

Config is a configuration parsed from a DSN string. If a new Config is created instead of being parsed from a DSN string, the NewConfig function should be used, which sets default values.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Config and sets default values.

func ParseDSN

func ParseDSN(dsn string) (*Config, error)

ParseDSN parses the DSN string to a Config

type Driver

type Driver struct{}

Driver is the Firestore driver structure

func (*Driver) Open

func (d *Driver) Open(dsn string) (driver.Conn, error)

Open establishes a new connection to the Firestore database

type Result

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) LastInsertId

func (r *Result) LastInsertId() (int64, error)

func (*Result) RowsAffected

func (r *Result) RowsAffected() (int64, error)

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

Rows represents a result set for a SQL query

func NewRows

func NewRows(results []map[string]interface{}, dryRun bool, selectStmt *query.Select) *Rows

NewRows creates a new result set from map values

func (*Rows) Close

func (r *Rows) Close() error

Close closes the rows iterator

func (*Rows) ColumnTypeDatabaseTypeName

func (r *Rows) ColumnTypeDatabaseTypeName(index int) string

ColumnTypeDatabaseTypeName returns the database type name of the column

func (*Rows) ColumnTypeNullable added in v0.1.1

func (r *Rows) ColumnTypeNullable(index int) (nullable, ok bool)

ColumnTypeNullable reports whether the column may be null ColumnTypeNullable reports whether the column may be null

func (*Rows) ColumnTypeScanType

func (r *Rows) ColumnTypeScanType(index int) reflect.Type

ColumnTypeScanType returns the ScanType of the column at the given index

func (*Rows) Columns

func (r *Rows) Columns() []string

Columns returns the names of the columns

func (*Rows) Next

func (r *Rows) Next(dest []driver.Value) error

Next moves the cursor to the next row

type Statement

type Statement struct {
	SQL string
	// contains filtered or unexported fields
}

func (*Statement) Close

func (s *Statement) Close() error

Close closes the statement

func (*Statement) Exec

func (s *Statement) Exec(args []driver.Value) (driver.Result, error)

Exec executes a non-query statement

func (*Statement) ExecContext

func (s *Statement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)

ExecContext executes a non-query statement with context

func (*Statement) NumInput

func (s *Statement) NumInput() int

NumInput returns the number of placeholder parameters

func (*Statement) Query

func (s *Statement) Query(args []driver.Value) (driver.Rows, error)

Query runs query

func (*Statement) QueryContext

func (s *Statement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

QueryContext executes a query statement with context

type SubCollection added in v0.1.1

type SubCollection struct {
	// contains filtered or unexported fields
}

SubCollection represents a subcollection reference

Jump to

Keyboard shortcuts

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