Documentation
¶
Index ¶
- func ClearDatabase(db *sql.DB, schema *Schema) error
- func CreateDatabase(filename string, removeExisting bool) (*sql.DB, error)
- func CreateDatabaseSchema(db *sql.DB, schema *Schema) (*sql.Result, error)
- func DeleteDatabase(filename string) error
- func GetDatabaseConnection(filename string) (*sql.DB, error)
- type Column
- type Schema
- type Synchronization
- func (s *Synchronization) SynchronizeCampuses(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeCarrierFacilities(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeCarriers(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeFacilities(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeInternetExchangeFacilities(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeInternetExchangeLANs(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeInternetExchangePrefixes(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeInternetExchanges(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeNetworkContacts(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeNetworkFacilities(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeNetworkInternetExchangeLANs(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeNetworks(bar *mpb.Bar)
- func (s *Synchronization) SynchronizeOrganizations(bar *mpb.Bar)
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDatabase ¶
ClearDatabase removes all data from the SQLite database keeping the schema.
func CreateDatabase ¶
CreateDatabase creates a new SQLite database file, removing the existing file if needed.
func CreateDatabaseSchema ¶
CreateDatabaseSchema creates the given schema in the SQLite database.
func DeleteDatabase ¶
DeleteDatabase deletes the given SQLite database file.
Types ¶
type Column ¶
type Column struct {
Name string // Column name
Type string // Data type (e.g., INTEGER, VARCHAR, etc.)
Constraints string // Constraints (e.g., NOT NULL, PRIMARY KEY, etc.)
}
Column represents a single column in a table schema.
type Schema ¶
type Schema struct {
Tables map[string]Table // List of tables
Indexes []string // List of indexes
}
Schema represents a schema of a database.
func (*Schema) GenerateSchemaQuery ¶
GenerateSchemaQuery generates the SQL CREATE TABLE statements from the Schema struct.
func (*Schema) GetTableNames ¶
GetTableNames returns the list of table names in the schema.
type Synchronization ¶
Synchronization is a structure holding pointers to the PeeringDB API and database being used.
func (*Synchronization) SynchronizeCampuses ¶
func (s *Synchronization) SynchronizeCampuses(bar *mpb.Bar)
func (*Synchronization) SynchronizeCarrierFacilities ¶
func (s *Synchronization) SynchronizeCarrierFacilities(bar *mpb.Bar)
func (*Synchronization) SynchronizeCarriers ¶
func (s *Synchronization) SynchronizeCarriers(bar *mpb.Bar)
func (*Synchronization) SynchronizeFacilities ¶
func (s *Synchronization) SynchronizeFacilities(bar *mpb.Bar)
func (*Synchronization) SynchronizeInternetExchangeFacilities ¶
func (s *Synchronization) SynchronizeInternetExchangeFacilities(bar *mpb.Bar)
func (*Synchronization) SynchronizeInternetExchangeLANs ¶
func (s *Synchronization) SynchronizeInternetExchangeLANs(bar *mpb.Bar)
func (*Synchronization) SynchronizeInternetExchangePrefixes ¶
func (s *Synchronization) SynchronizeInternetExchangePrefixes(bar *mpb.Bar)
func (*Synchronization) SynchronizeInternetExchanges ¶
func (s *Synchronization) SynchronizeInternetExchanges(bar *mpb.Bar)
func (*Synchronization) SynchronizeNetworkContacts ¶
func (s *Synchronization) SynchronizeNetworkContacts(bar *mpb.Bar)
func (*Synchronization) SynchronizeNetworkFacilities ¶
func (s *Synchronization) SynchronizeNetworkFacilities(bar *mpb.Bar)
func (*Synchronization) SynchronizeNetworkInternetExchangeLANs ¶
func (s *Synchronization) SynchronizeNetworkInternetExchangeLANs(bar *mpb.Bar)
func (*Synchronization) SynchronizeNetworks ¶
func (s *Synchronization) SynchronizeNetworks(bar *mpb.Bar)
func (*Synchronization) SynchronizeOrganizations ¶
func (s *Synchronization) SynchronizeOrganizations(bar *mpb.Bar)
type Table ¶
type Table struct {
Name string // Table name
Columns []Column // List of columns
UniquenessConstraints []string // List of uniqueness constraints
}
Table represents a schema of a table.
func (*Table) GetColumnsNames ¶
GetColumnsNames returns the list of column names in the table without the "id" one.