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 03e7b02 commit a381a07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions meta/sqlite/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ END;
var stream = Table{
Create: streamCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO stream (site_id, band, source, sampling_rate, axial, reversed, triggered, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);",
return fmt.Sprintf("INSERT INTO stream (site_id, band, source, sampling_rate, axial, reversed, triggered, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);",
site.Select(),
)
},
Expand Down Expand Up @@ -403,8 +403,8 @@ END;
var connection = Table{
Create: connectionCreate,
Insert: func() string {
return fmt.Sprintf("INSERT OR IGNORE INTO connection (site_id, place_role_id, number, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?);",
model.Select(), placeRole.Select(),
return fmt.Sprintf("INSERT INTO connection (site_id, place_role_id, number, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?);",
site.Select(), placeRole.Select(),
)
},
Fields: []string{"Station", "Location", "Place", "Role", "Number", "Start Date", "End Date"},
Expand All @@ -425,7 +425,7 @@ var placeRole = Table{
return "SELECT place_role_id FROM place_role WHERE place = ? AND role = ?"
},
Insert: func() string {
return "INSERT OR IGNORE INTO place_role (place, role) VALUES (?, ?);"
return "INSERT INTO place_role (place, role) VALUES (?, ?) ON CONFLICT(place, role) DO NOTHING;"
},
Fields: []string{"Place", "Role"},
}

0 comments on commit a381a07

Please sign in to comment.