Documentation ¶
Index ¶
- type Aerospike
- type AerospikeError
- type CypherQuery
- type MySQL
- func (m *MySQL) ConfigString() string
- func (m *MySQL) Connect() error
- func (m *MySQL) Default(user, password, address, dbName string)
- func (m *MySQL) Delete(namedQuery string, deleteStructs any) (int64, error)
- func (m *MySQL) DeleteOne(namedQuery string, deleteStruct any) error
- func (m *MySQL) Insert(namedQuery string, insertStruct any) error
- func (m *MySQL) InsertOne(namedQuery string, insertStruct any) (int64, error)
- func (m *MySQL) MatchError(err error) MySQLError
- func (m *MySQL) RawQuery(query string, args ...any) (*sql.Rows, error)
- func (m *MySQL) Select(into any, query string, args ...any) (any, error)
- func (m *MySQL) SelectOne(into any, query string, args ...any) (any, error)
- func (m *MySQL) String() string
- func (m *MySQL) Update(namedQuery string, updateStructs any) error
- func (m *MySQL) UpdateOne(namedQuery string, updateStruct any) (int64, error)
- type MySQLError
- type Neo4j
- type Redis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aerospike ¶ added in v1.4.7
type Aerospike struct { Client *aerospike.Client `json:"-"` Hostname string `json:"hostname,omitempty"` Port int `json:"port,omitempty"` TLSName string `json:"TLSName,omitempty"` Policy *aerospike.ClientPolicy `json:"-"` GlobalNamespace string `json:"globalNamespace,omitempty"` GlobalSetName string `json:"globalSetName,omitempty"` }
Aerospike is our primary struct
func (*Aerospike) Default ¶ added in v1.4.7
Default creates a default config based on given parameters
type AerospikeError ¶ added in v1.4.7
AerospikeError provides a common struct for Aerospike Errors
type CypherQuery ¶
type CypherQuery struct { Results interface{} Statement string Parameters neoism.Props }
CypherQuery is our query struct
func (*CypherQuery) String ¶
func (c *CypherQuery) String() string
String returns our query struct as a JSON string
type MySQL ¶
type MySQL struct { LastQuery string Connection *sqlx.DB Config mysql.Config MaxOpenConnections int Connected bool }
MySQL is our primary struct
func (*MySQL) ConfigString ¶
ConfigString turns our configuration into a JSON string
func (*MySQL) Delete ¶
Delete performs a deletion
persons := []Person{ {Id: 0}, {Id: 1}, } err = db.NamedExec(`DELETE FROM persons WHERE id=:id`, persons)
func (*MySQL) DeleteOne ¶ added in v1.3.7
DeleteOne performs a deletion
persons := Person{Id: 0} err = db.NamedExec(`DELETE FROM persons WHERE id=:id`, persons)
func (*MySQL) Insert ¶
Insert many structs into a named query using sqlx standards
persons := []Person{ {FirstName: "Ardie"}, {FirstName: "Sonny"}, } err = db.NamedExec(`INSERT INTO persons (first_name) VALUES (:first_name)`, persons)
func (*MySQL) InsertOne ¶ added in v1.3.7
InsertOne one struct into a named query using sqlx standards
person := Person{ FirstName: "Ardie" } lastInsertId, err = db.NamedExec(`INSERT INTO persons (first_name) VALUES (:first_name)`, person)
func (*MySQL) MatchError ¶ added in v1.3.8
func (m *MySQL) MatchError(err error) MySQLError
MatchError matches a MySQL error with a given list of known errors (to be expanded) and returns a MySQLError
func (*MySQL) Select ¶
Select for more than one result is expected
countries := []Countries{} countries, err := db.Select(&countries, "SELECT * FROM countries ORDER BY name ASC")
func (*MySQL) SelectOne ¶
SelectOne single result, stored within arg:into
country := Country{} country, err := db.Select(&country, "SELECT * FROM countries WHERE name='Germany' ORDER BY name ASC")
type MySQLError ¶ added in v1.3.8
MySQLError provides a common struct for MySQL Errors
type Neo4j ¶
Neo4j is our primary struct
func (*Neo4j) CypherQuery ¶
func (n *Neo4j) CypherQuery(query CypherQuery) (interface{}, error)
CypherQuery perform a query - results will be populated with the query results - it must be a slice of structs.
func (*Neo4j) TransactCypherQuery ¶
func (n *Neo4j) TransactCypherQuery(queries []CypherQuery) (interface{}, error)
TransactCypherQuery creates a CyperQuery Transaction
type Redis ¶
type Redis struct { Options *redis.Options IsConnected bool // contains filtered or unexported fields }
Redis is our primary struct
func (*Redis) CheckIfConnected ¶
CheckIfConnected Checks our connection status to our Redis DB
func (*Redis) GetRawConnectionAndContext ¶
GetRawConnectionAndContext returns both our Redis Client and the latest context