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 348e982 commit d0337f2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions meta/sqlite/gauge.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var gauge = Table{
return "SELECT gauge_id FROM gauge WHERE gauge = ?"
},
Insert: func() string {
return "INSERT OR IGNORE INTO gauge (gauge, identification_number, analysis_time_zone, analysis_latitude, analysis_longitude, crex_tag, start_date, end_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"
return "INSERT INTO gauge (gauge, identification_number, analysis_time_zone, analysis_latitude, analysis_longitude, crex_tag, start_date, end_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"
},
Fields: []string{"Gauge", "Identification Number", "Analysis Time Zone", "Analysis Latitude", "Analysis Longitude", "Crex Tag", "Start Date", "End Date"},
}
Expand Down Expand Up @@ -61,7 +61,7 @@ END;
var constituent = Table{
Create: constituentCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO constituent (gauge, number, constituent, amplitude, lag, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO constituent (gauge, number, constituent, amplitude, lag, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?);",
gauge.Select(),
)
},
Expand Down Expand Up @@ -95,7 +95,7 @@ END;
var dart = Table{
Create: dartCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO dart (station_id, pid, wmo_identifier, start_date, end_date) VALUES ((%s), ?, ?, ?, ?);", station.Select())
return fmt.Sprintf("INSERT INTO dart (station_id, pid, wmo_identifier, start_date, end_date) VALUES ((%s), ?, ?, ?, ?);", station.Select())
},
Fields: []string{"Station", "Pid", "WMO Identifier", "Start Date", "End Date"},
}
6 changes: 3 additions & 3 deletions meta/sqlite/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var mount = Table{
return "SELECT mount_id FROM mount WHERE mount = ?"
},
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO mount (datum_id, mount, name, latitude, longitude, elevation, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO mount (datum_id, mount, name, latitude, longitude, elevation, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);",
datum.Select(),
)
},
Expand All @@ -54,7 +54,7 @@ var mountNetwork = Table{
)
},
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO mount_network (mount_id, network_id) VALUES ((%s), (%s));",
return fmt.Sprintf("INSERT INTO mount_network (mount_id, network_id) VALUES ((%s), (%s));",
mount.Select(), network.Select())
},

Expand Down Expand Up @@ -108,7 +108,7 @@ var view = Table{
)
},
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO view (mount_id, view, label, azimuth, dip, method, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO view (mount_id, view, label, azimuth, dip, method, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);",
mount.Select(),
)
},
Expand Down
10 changes: 5 additions & 5 deletions meta/sqlite/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ END;
var antenna = Table{
Create: antennaCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO antenna (asset_id, mark_id, height, north, east, azimuth, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO antenna (asset_id, mark_id, height, north, east, azimuth, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?, ?, ?, ?);",
asset.Select(), mark.Select(),
)
},
Expand Down Expand Up @@ -80,7 +80,7 @@ END;
var metsensor = Table{
Create: metsensorCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO metsensor (asset_id, mark_id, datum_id, ims_comment, humidity, pressure, temperature, latitude, longitude, elevation, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO metsensor (asset_id, mark_id, datum_id, ims_comment, humidity, pressure, temperature, latitude, longitude, elevation, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);",
asset.Select(), mark.Select(), datum.Select(),
)
},
Expand Down Expand Up @@ -115,7 +115,7 @@ END;
var radome = Table{
Create: radomeCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO radome (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);",
return fmt.Sprintf("INSERT INTO radome (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);",
asset.Select(), mark.Select(),
)
},
Expand Down Expand Up @@ -150,7 +150,7 @@ END;
var receiver = Table{
Create: receiverCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO receiver (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);",
return fmt.Sprintf("INSERT INTO receiver (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);",
asset.Select(), mark.Select(),
)
},
Expand Down Expand Up @@ -192,7 +192,7 @@ END;
var session = Table{
Create: sessionCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO session (mark_id, operator, agency, model, satellite, interval, elevation_mask, header_comment, format, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO session (mark_id, operator, agency, model, satellite, interval, elevation_mask, header_comment, format, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
mark.Select(),
)
},
Expand Down
6 changes: 3 additions & 3 deletions meta/sqlite/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ END;
var sensor = Table{
Create: sensorCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO sensor (asset_id, site_id, method_id, azimuth, dip, depth, north, east, scale_factor, scale_bias, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO sensor (asset_id, site_id, method_id, azimuth, dip, depth, north, east, scale_factor, scale_bias, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);",
asset.Select(), site.Select(), method.Select(),
)
},
Expand Down Expand Up @@ -316,7 +316,7 @@ END;
var recorder = Table{
Create: recorderCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO recorder (asset_id, model_id, site_id, method_id, azimuth, dip, depth, start_date, end_date) VALUES ((%s), (%s), (%s), (%s), ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO recorder (asset_id, model_id, site_id, method_id, azimuth, dip, depth, start_date, end_date) VALUES ((%s), (%s), (%s), (%s), ?, ?, ?, ?, ?);",
asset.Select(), model.Select(), site.Select(), method.Select(),
)
},
Expand All @@ -325,7 +325,7 @@ var recorder = Table{

var recorderModel = Table{
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO model (make_id, model) VALUES ((%s), ?);",
return fmt.Sprintf("INSERT INTO model (make_id, model) VALUES ((%s), ?) ON CONFLICT(make_id, model) DO NOTHING;",
mmake.Select(),
)
},
Expand Down

0 comments on commit d0337f2

Please sign in to comment.