Initial setup of environment service

This commit is contained in:
2024-01-13 21:20:09 -05:00
parent bacc7c1c67
commit b5f2a6b535
22 changed files with 892 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
BEGIN TRANSACTION
INSERT Reading
(Timestamp, Name, Model, Temperature, Pressure, Humidity, Luminance, GasResistance, ColorTemperature, AirQualityIndex)
SELECT
@Timestamp,
@Name,
@Model,
@Temperature,
@Pressure,
@Humidity,
@Luminance,
@GasResistance,
@ColorTemperature,
@AirQualityIndex
WHERE NOT EXISTS
(
SELECT
1
FROM
Reading WITH (UPDLOCK, SERIALIZABLE)
WHERE Timestamp = @Timestamp AND Name = @Name AND Model = @Model
)
COMMIT TRANSACTION