Documentation ¶
Index ¶
- type DB
- func (db *DB) DeleteUserSettings(name string, connector string) error
- func (db *DB) DestructiveMigrateForTests() error
- func (db *DB) EmptyStorage() error
- func (db *DB) GetUserSettings(name string, connector string) (*user_settings.GetUserSettingsResponse, error)
- func (db *DB) PutUserSettings(name string, connector string, ...) (*user_settings.PutUserSettingsResponse, error)
- type UserSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
Postgres is a wrapping struct that will hold the database mapping object from the underlying db/sql implementation (gorp) plus our service config specifically for storage.
Additionally this struct implements our storage.Client interface
func ConnectAndMigrate ¶
ConnectAndMigrate creates a new Postgres client, connects to the database server and runs the migrations
func (*DB) DeleteUserSettings ¶
func (*DB) DestructiveMigrateForTests ¶
DestructiveMigrateForTests will: * Drop the database to give you a clean slate * Run all your migrations * Forcibly run all the migrations again to verify that they are idempotent.
Obviously you don't want this for production, but you should use it instead of the plain Migrate function in your tests if you can.
func (*DB) EmptyStorage ¶
EmptyStorage deletes all the data from the database @afiune This function is only used by our Integration Test framework
func (*DB) GetUserSettings ¶
func (db *DB) GetUserSettings(name string, connector string) (*user_settings.GetUserSettingsResponse, error)
GetUserSettings retrieves user settings from the database
func (*DB) PutUserSettings ¶
func (db *DB) PutUserSettings(name string, connector string, settings map[string]*user_settings.UserSettingValue) (*user_settings.PutUserSettingsResponse, error)
type UserSettings ¶
type UserSettings struct { Id int32 `db:"id, primarykey, autoincrement"` UserName string `db:"user_name"` Connector string `db:"connector"` Settings json.RawMessage `db:"settings"` }