Documentation
¶
Index ¶
- func GetDevMode() bool
- func GetDuckDBConnection() (*sql.DB, error)
- func GetDuckDBFilename() string
- func GetDuckdbSafeMigrationEmbed() string
- func GetDuckdbUpMigrationEmbed() string
- func GetDuckdbViewsMigration() string
- func GetDuckdbViewsMigrationEmbed() string
- func Open(filename string) (*sql.DB, error)
- func RowsToCSV(rows *sql.Rows) (string, error)
- func RunMigration(conn *sql.DB) error
- func RunSafeMode(conn *sql.DB) error
- func SetDevMode(isOn bool)
- func SetDuckDBFilename(filename string)
- func String(str string) string
- type MigrationInfo
- type TimezoneInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDevMode ¶
func GetDevMode() bool
func GetDuckDBConnection ¶
GetDuckDBConnection returns the a Screentime DuckDB connection
func GetDuckDBFilename ¶
func GetDuckDBFilename() string
GetDuckDBFilename returns the DuckDB filename.
func GetDuckdbSafeMigrationEmbed ¶
func GetDuckdbSafeMigrationEmbed() string
func GetDuckdbUpMigrationEmbed ¶
func GetDuckdbUpMigrationEmbed() string
func GetDuckdbViewsMigration ¶
func GetDuckdbViewsMigration() string
func GetDuckdbViewsMigrationEmbed ¶
func GetDuckdbViewsMigrationEmbed() string
func RunMigration ¶
RunMigration executes the migration string on the DuckDB connection. Returns an error, if any.
func RunSafeMode ¶
RunSafeMode locks the database down with the DuckdbSafeMigration. Returns an error, if any
func SetDevMode ¶
func SetDevMode(isOn bool)
func SetDuckDBFilename ¶
func SetDuckDBFilename(filename string)
SetDuckDBFilename sets the DuckDB filename. Default is :memory:
Types ¶
type MigrationInfo ¶
type MigrationInfo struct { HomeDir string TimezoneInfo TimezoneInfo }
MigrationInfo holds data to be injected by our migration template
type TimezoneInfo ¶
type TimezoneInfo struct { Timestamp int64 `json:"timestamp"` Location string `json:"location"` Timezone string `json:"timezone"` UTCOffsetSeconds int `json:"offset"` IsDST bool `json:"is_dst"` IsWeekend bool `json:"is_weekend"` DayOfWeek int `json:"day_of_week"` }
TimezoneInfo represents timezone information for the database
Click to show internal directories.
Click to hide internal directories.