Documentation ¶
Index ¶
- func FixedLenRandomString(length int) string
- func NewSessionDb(connP *ConnectParams) (*Session, *Database, error)
- func RandomInt(num int) (int, error)
- func RandomString(min, max int) string
- type ConnectParams
- type Database
- func (d *Database) Collection(name string) (driver.Collection, error)
- func (d *Database) Count(query string) (int64, error)
- func (d *Database) CountWithParams(query string, bindVars map[string]interface{}) (int64, error)
- func (d *Database) CreateCollection(name string, opt *driver.CreateCollectionOptions) (driver.Collection, error)
- func (d *Database) Do(query string, bindVars map[string]interface{}) error
- func (d *Database) DoRun(query string, bindVars map[string]interface{}) (*Result, error)
- func (d *Database) Drop() error
- func (d *Database) EnsureGeoIndex(coll string, fields []string, opts *driver.EnsureGeoIndexOptions) (driver.Index, bool, error)
- func (d *Database) EnsureHashIndex(coll string, fields []string, opts *driver.EnsureHashIndexOptions) (driver.Index, bool, error)
- func (d *Database) EnsurePersistentIndex(coll string, fields []string, opts *driver.EnsurePersistentIndexOptions) (driver.Index, bool, error)
- func (d *Database) EnsureSkipListIndex(coll string, fields []string, opts *driver.EnsureSkipListIndexOptions) (driver.Index, bool, error)
- func (d *Database) Exec(query string) error
- func (d *Database) FindOrCreateCollection(name string, opt *driver.CreateCollectionOptions) (driver.Collection, error)
- func (d *Database) FindOrCreateGraph(name string, defs []driver.EdgeDefinition) (driver.Graph, error)
- func (d *Database) Get(query string) (*Result, error)
- func (d *Database) GetRow(query string, bindVars map[string]interface{}) (*Result, error)
- func (d *Database) Handler() driver.Database
- func (d *Database) Run(query string) (*Result, error)
- func (d *Database) Search(query string) (*Resultset, error)
- func (d *Database) SearchRows(query string, bindVars map[string]interface{}) (*Resultset, error)
- func (d *Database) Truncate(names ...string) error
- func (d *Database) ValidateQ(q string) error
- type Result
- type Resultset
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedLenRandomString ¶ added in v0.4.0
func NewSessionDb ¶
func NewSessionDb(connP *ConnectParams) (*Session, *Database, error)
NewSessionDb connects to arangodb and returns a new session and database instances.
func RandomString ¶ added in v0.4.0
Generates a random string between a range(min and max) of length.
Types ¶
type ConnectParams ¶
type ConnectParams struct { User string `validate:"required"` Pass string `validate:"required"` Database string `validate:"required"` Host string `validate:"required"` Port int `validate:"required"` Istls bool }
ConnectParams are the parameters required for connecting to arangodb.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database struct.
func (*Database) Collection ¶
func (d *Database) Collection(name string) (driver.Collection, error)
Collection returns collection attached to current database.
func (*Database) CountWithParams ¶
CountWithParams query the database with bind parameters that is expected to return count of result.
func (*Database) CreateCollection ¶
func (d *Database) CreateCollection( name string, opt *driver.CreateCollectionOptions, ) (driver.Collection, error)
CreateCollection creates a collection in the database.
func (*Database) Do ¶
Do is to run data modification query with bind parameters that is not expected to return any result.
func (*Database) DoRun ¶
DoRun is to run data modification query with bind parameters that is expected to return a result. It is an alias for GetRow.
func (*Database) EnsureGeoIndex ¶ added in v0.2.0
func (d *Database) EnsureGeoIndex( coll string, fields []string, opts *driver.EnsureGeoIndexOptions, ) (driver.Index, bool, error)
EnsureGeoIndex finds or creates a geo index on a specified collection.
func (*Database) EnsureHashIndex ¶ added in v0.2.0
func (d *Database) EnsureHashIndex( coll string, fields []string, opts *driver.EnsureHashIndexOptions, ) (driver.Index, bool, error)
EnsureHashIndex finds or creates a hash index on a specified collection.
func (*Database) EnsurePersistentIndex ¶ added in v0.2.0
func (d *Database) EnsurePersistentIndex( coll string, fields []string, opts *driver.EnsurePersistentIndexOptions, ) (driver.Index, bool, error)
EnsurePersistentIndex finds or creates a persistent index on a specified collection.
func (*Database) EnsureSkipListIndex ¶ added in v0.2.0
func (d *Database) EnsureSkipListIndex( coll string, fields []string, opts *driver.EnsureSkipListIndexOptions, ) (driver.Index, bool, error)
EnsureSkipListIndex finds or creates a skip list index on a specified collection.
func (*Database) Exec ¶
Exec is to run data modification query that is not expected to return any result.
func (*Database) FindOrCreateCollection ¶
func (d *Database) FindOrCreateCollection( name string, opt *driver.CreateCollectionOptions, ) (driver.Collection, error)
FindOrCreateCollection finds or creates a collection in the database. The method is expected to be called by the user who has privileges to create the collection.
func (*Database) FindOrCreateGraph ¶
func (d *Database) FindOrCreateGraph( name string, defs []driver.EdgeDefinition, ) (driver.Graph, error)
FindOrCreateGraph finds or creates a named graph in the database.
func (*Database) GetRow ¶
GetRow query the database with bind parameters that is expected to return single row of result.
func (*Database) Run ¶
Run is to run data modification query that is expected to return a result It is a convenient alias for Get method.
func (*Database) Search ¶
Search query the database that is expected to return multiple rows of result.
func (*Database) SearchRows ¶
SearchRows query the database with bind parameters that is expected to return multiple rows of result.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is a cursor for single row of data.
type Resultset ¶
type Resultset struct {
// contains filtered or unexported fields
}
Resultset is a cursor for multiple rows of result.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a connected database client.
func NewSessionFromClient ¶
NewSessionFromClient creates a new Session from an existing client
You could also do this &Session{client} Funny isn't it
func (*Session) CreateDB ¶
func (s *Session) CreateDB( name string, opt *driver.CreateDatabaseOptions, ) error
CreateDB creates database.
func (*Session) CreateUser ¶
CreateUser creates user.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
command
|
|
Package testarango is a golang library to write unit tests for arangodb based packages and applications.
|
Package testarango is a golang library to write unit tests for arangodb based packages and applications. |