Commit Graph

28 Commits

Author SHA1 Message Date
Markus Pesch 226a5f3383
test(ci): start postgres db as drone service
continuous-integration/drone/push Build is passing Details
2022-03-18 18:37:53 +01:00
Markus Pesch ffbc8a793c
fix: golangci-lint and gosec warnings 2021-05-26 19:47:15 +02:00
Markus Pesch 9207833a71
fix: add missing error handling 2021-04-09 16:55:35 +02:00
Markus Pesch 749f2697c7
feat: import from sqlite or postgres 2021-04-09 16:52:25 +02:00
Markus Pesch 8c2090a316
fix: rename ddl assets 2021-04-06 19:40:56 +02:00
Markus Pesch a48ae72b4b
fix: postgres embed - use direct sql statements instead of asset paths 2021-04-06 19:19:29 +02:00
Markus Pesch b7e7e55916
fix: sqlite3 embed - use direct sql statements instead of asset paths 2021-04-06 19:19:25 +02:00
Markus Pesch 53d4a78adc
refac: sort sqlite and postgres funcs 2021-03-21 22:31:00 +01:00
Markus Pesch fb23874422
fix: remove deprecated repository code 2021-03-21 22:22:40 +01:00
Markus Pesch 7a88aaac0c
refac: use embed instead of go-bindata, secure closing of transactions 2021-03-21 21:43:53 +01:00
Markus Pesch 59db7cfc85
fix: rename postgresql constraints 2021-01-30 16:51:21 +01:00
Markus Pesch 366dccde12
fix: use go-migrate pkg to init or update db schema
Instead to implement own logic how the database scheme should be updated
or migrated to a newer or older version flucky use now instead the
go-migrate package.
2021-01-30 15:44:21 +01:00
Markus Pesch 23695b4513
fix: update rows when already exist during an import
When rows in the table devices, sensors, humidities, pressures and
temperatures already exist, they will only be updated.
2020-12-14 20:54:20 +01:00
Markus Pesch 522fe2746a
fix: add or update devices, sensors and measured values
Add additional functions to the repository to add or update devices,
sensors or measured values. Furthermore the test has been adapt to the
new functions.
2020-12-14 20:54:20 +01:00
Markus Pesch d0cfdd7102
fix: exclude dockerutils and testutils package 2020-11-07 23:03:11 +01:00
Markus Pesch 675af77965
feat: import from sqlite or postgresql 2020-11-07 22:59:48 +01:00
Markus Pesch a2e66ce08b
fix: sqlite and postgres, close rows and pass nothing instead nil 2020-11-06 23:07:10 +01:00
Markus Pesch 0fc4aa7c28
fix: postgres columns with timezone
Add timezone for the columns creation_date and update_date, otherwise
it's difficult to compare the times correctly in the unit test.

Furthermore the default value of the creation_date will now be defined
by the postgres implementation of the database interface.
2020-10-07 23:38:27 +02:00
Markus Pesch 3a090d190e
fix: cli temperature read
changes:
- fix: read temperature values without daemon
  Add subcommand to read temperature values without starting the daemon

- fix: implement measured value types
  Replace measured value types with constants

- fix: add sensor pipelines
  Add functions which returns a channel with measured values

- fix: filter measured values from a channel
  Add functions to filter measured values by sensor id or measured
  value types.
2020-09-21 20:05:37 +02:00
Markus Pesch 8c1bd57ad5
fix: gnu-cc, missing humidity table, restrict repository select 2020-06-27 21:12:00 +02:00
Markus Pesch 92a776f6ce
fix: missing package import 2020-06-27 18:14:49 +02:00
Markus Pesch 0384bbd574
fix: move sql driver import into main.go 2020-06-10 21:25:52 +02:00
Markus Pesch a49546bd6d
fix: migrate to gitea 2020-06-10 21:13:05 +02:00
Markus Pesch 4931c63c10
fix: add postgres backend
changes:
- Add postgres backend
- Modified or added table attributes.
  UpdateDate, ForeignKeys, Booleans
- Fix test for sqlite and postgres. Compare json instead the struct.
2020-06-01 22:50:05 +02:00
Markus Pesch 10069568f9
fix: renamed storage endpoint into dsn
Changes:
- Renamed storage endpoint into dsn (data source name).
- Add additional dsn fallback property. This dsn will be used in futes
  to store informations, if the main dsn backend does not work
  correctly. For example, if no connection can be established over the
  network to a database.
2020-06-01 12:41:48 +02:00
Markus Pesch 43e9d00dcb
fix: implement repository test
changes:
- Implement repository test for the sqlite backend
- Add testutils package to start container images
- Remove deprecated till_date in measured values
- Renamed columns of the table humidities, pressures and temperatures
2020-06-01 00:56:04 +02:00
Markus Pesch d0e238e64a
fix: use repository instead db package 2020-05-21 20:07:32 +02:00
Markus Pesch 8f1c7b10f7
fix: implement repository pkg 2020-05-21 17:40:24 +02:00