Documentation ¶
Index ¶
- Variables
- type MockSqliteDatastore
- func (ds *MockSqliteDatastore) TablesEqual(t *testing.T, wantTables []string) ([]string, bool)
- func (ds *MockSqliteDatastore) WithExercise(t *testing.T, id int, workout int, name string, weight float64, reps int, ...)
- func (ds *MockSqliteDatastore) WithUser(t *testing.T, id int, email string, pass string)
- func (ds *MockSqliteDatastore) WithWorkout(t *testing.T, workoutID int, owner int, name string)
- type SqliteDatastore
- type SqliteDatastoreConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSqliteConfig = SqliteDatastoreConfig{ DatabaseURL: "file://./musclemem.sqlite", MigrationURL: "file://./migrations/", Overwrite: false, ForeignKeyEnforced: true, }
Functions ¶
This section is empty.
Types ¶
type MockSqliteDatastore ¶
type MockSqliteDatastore struct {
*SqliteDatastore
}
func NewMockSqliteDatastore ¶
func NewMockSqliteDatastore(t *testing.T) *MockSqliteDatastore
func (*MockSqliteDatastore) TablesEqual ¶
func (*MockSqliteDatastore) WithExercise ¶
func (*MockSqliteDatastore) WithWorkout ¶
type SqliteDatastore ¶
func NewSqliteDatastore ¶
func NewSqliteDatastore(config SqliteDatastoreConfig) (*SqliteDatastore, error)
NewSqliteDatastore creates a new database at dbURL and runs the migrations in the defaultMigrations folder if overwrite is false, it returns the existing db
func (*SqliteDatastore) CompileStatement ¶
CompileStatement prepares a SQL statement using tqla.Template statement will be populated with the data argument like {{ .ID }}
Click to show internal directories.
Click to hide internal directories.