Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ozym committed Nov 23, 2024
1 parent 821e990 commit a1e5edd
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 295 deletions.
2 changes: 1 addition & 1 deletion meta/placenames.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var placenameHeaders Header = map[string]int{
}

var PlacenameTable Table = Table{
name: "Name",
name: "Placename",
headers: placenameHeaders,
primary: []string{"Name"},
native: []string{"Latitude", "Longitude", "Level"},
Expand Down
4 changes: 1 addition & 3 deletions meta/sqlite/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,7 @@ func (d DB) Init(ctx context.Context, list []meta.TableList) error {
return err
}
default:
log.Println(l.List)

log.Println(l.Table.Name())
log.Printf("ignoring %s", l.Table.Name())
}
}

Expand Down
55 changes: 0 additions & 55 deletions meta/sqlite/monument.go

This file was deleted.

54 changes: 0 additions & 54 deletions meta/sqlite/network.go

This file was deleted.

20 changes: 20 additions & 0 deletions meta/sqlite/response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package sqlite

const responseCreate = `
DROP TABLE IF EXISTS response;
CREATE TABLE IF NOT EXISTS response (
response_id INTEGER PRIMARY KEY NOT NULL,
response TEXT NOT NULL,
UNIQUE (response)
);`

var response = Table{
Create: responseCreate,
Select: func() string {
return "SELECT response_id FROM response WHERE response = ?"
},
Insert: func() string {
return "INSERT OR IGNORE INTO response (response) VALUES (?);"
},
Fields: []string{"Response"},
}
54 changes: 0 additions & 54 deletions meta/sqlite/sample.go

This file was deleted.

54 changes: 0 additions & 54 deletions meta/sqlite/site.go

This file was deleted.

71 changes: 0 additions & 71 deletions meta/sqlite/sql.go

This file was deleted.

2 changes: 1 addition & 1 deletion meta/sqlite/station.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ CREATE TABLE IF NOT EXISTS class_citation (
UNIQUE (class_id, citation_id)
);`

var classCitations = Table{
var classCitation = Table{
Create: classCitationCreate,
Select: func() string {
return fmt.Sprintf("SELECT class_citation_id FROM class_citation WHERE class_id = (%s) AND citation_id = (%s)",
Expand Down
5 changes: 3 additions & 2 deletions meta/table.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package meta

import (
"slices"
"sort"
)

Expand Down Expand Up @@ -174,7 +175,7 @@ func (s *Set) KeyValue(name, label, desc string, entries map[string]string) Tabl

// TableList returns a pre-built set of Tables and associated Lists.
func (s *Set) TableList(extra ...TableList) []TableList {
return append([]TableList{
return append(slices.Clone(extra), []TableList{
{Table: NetworkTable, List: NetworkList(s.Networks())},
{Table: StationTable, List: StationList(s.Stations())},
{Table: SiteTable, List: SiteList(s.Sites())},
Expand Down Expand Up @@ -214,5 +215,5 @@ func (s *Set) TableList(extra ...TableList) []TableList {
{Table: TelemetryTable, List: TelemetryList(s.Telemetries())},
{Table: TimingTable, List: TimingList(s.Timings())},
{Table: VisibilityTable, List: VisibilityList(s.Visibilities())},
}, extra...)
}...)
}

0 comments on commit a1e5edd

Please sign in to comment.