apiinit

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package apiinit contains internal implementation for InitializeRuntime

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeRuntime

func InitializeRuntime(runtimeConfig *apptypes.RuntimeConfig) (*apptypes.MobsqlRuntime, error)

InitializeRuntime must be called before all other functions for mobsql and it creates the [MobsqlRuntime]. This holds the database connection and calling this function ensures some bootstrapping DB seeding etc. occurs.

Internally this function does 4 primary things:

  1. Opens the SQLite database - setting pragmas etc according
  2. Runs schema creation logic (e.g. create tables)
  3. Fetches from HTTP the Mobility Database CSV file & imports to _mdb table (cached)
  4. Returns the prepared 'runtime', returning MobsqlRuntime{} which all other APIs operate based on (which contains the opened DB)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL