fix: new implementation
changes:
- Remove cli
  Some cli commands are not complete tested and are deprecated.
- Daemon
  - Old version has a very bad implementation of how to verify, if the
    device or the sensors are in the database insert. The current
    implementation can be improved but this one is betten then the old
    one.
  - Remove complete the cache store implementation. Use a normal array
    and query the length and capacity to determine how the array cache
    must be cleaned.
- Type
  Remove unused types and functions
			
			
This commit is contained in:
		
							
								
								
									
										7
									
								
								pkg/storage/postgres/insertDevice.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								pkg/storage/postgres/insertDevice.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
INSERT INTO devices (
 | 
			
		||||
  device_id,
 | 
			
		||||
  device_name,
 | 
			
		||||
  device_location,
 | 
			
		||||
  creation_date
 | 
			
		||||
)
 | 
			
		||||
VALUES ($1, $2, $3, $4);
 | 
			
		||||
							
								
								
									
										10
									
								
								pkg/storage/postgres/insertHumidity.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								pkg/storage/postgres/insertHumidity.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
INSERT INTO humidities (
 | 
			
		||||
  humidity_id,
 | 
			
		||||
  humidity_value,
 | 
			
		||||
  humidity_from_date,
 | 
			
		||||
  humidity_till_date,
 | 
			
		||||
  sensor_id,
 | 
			
		||||
  creation_date,
 | 
			
		||||
  update_date
 | 
			
		||||
)
 | 
			
		||||
VALUES ($1, $2, $3, $4, $5, $6, $7);
 | 
			
		||||
							
								
								
									
										10
									
								
								pkg/storage/postgres/insertPressure.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								pkg/storage/postgres/insertPressure.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
INSERT INTO pressures (
 | 
			
		||||
  pressure_id,
 | 
			
		||||
  pressure_value,
 | 
			
		||||
  pressure_from_date,
 | 
			
		||||
  pressure_till_date,
 | 
			
		||||
  sensor_id,
 | 
			
		||||
  creation_date,
 | 
			
		||||
  update_date
 | 
			
		||||
)
 | 
			
		||||
VALUES ($1, $2, $3, $4, $5, $6, $7);
 | 
			
		||||
							
								
								
									
										14
									
								
								pkg/storage/postgres/insertSensor.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								pkg/storage/postgres/insertSensor.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
INSERT INTO sensors (
 | 
			
		||||
  sensor_id,
 | 
			
		||||
  sensor_name,
 | 
			
		||||
  sensor_location,
 | 
			
		||||
  wire_id,
 | 
			
		||||
  i2c_bus,
 | 
			
		||||
  i2c_address,
 | 
			
		||||
  gpio_number,
 | 
			
		||||
  sensor_model,
 | 
			
		||||
  sensor_enabled,
 | 
			
		||||
  device_id,
 | 
			
		||||
  creation_date
 | 
			
		||||
)
 | 
			
		||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);
 | 
			
		||||
							
								
								
									
										10
									
								
								pkg/storage/postgres/insertTemperature.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								pkg/storage/postgres/insertTemperature.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
INSERT INTO temperatures (
 | 
			
		||||
  temperature_id,
 | 
			
		||||
  temperature_value,
 | 
			
		||||
  temperature_from_date,
 | 
			
		||||
  temperature_till_date,
 | 
			
		||||
  sensor_id,
 | 
			
		||||
  creation_date,
 | 
			
		||||
  update_date
 | 
			
		||||
)
 | 
			
		||||
VALUES ($1, $2, $3, $4, $5, $6, $7);
 | 
			
		||||
							
								
								
									
										8
									
								
								pkg/storage/postgres/selectDeviceByID.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								pkg/storage/postgres/selectDeviceByID.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
SELECT
 | 
			
		||||
  device_id,
 | 
			
		||||
  device_name,
 | 
			
		||||
  device_location,
 | 
			
		||||
  creation_date
 | 
			
		||||
FROM
 | 
			
		||||
  devices
 | 
			
		||||
WHERE device_id = $1;
 | 
			
		||||
							
								
								
									
										16
									
								
								pkg/storage/postgres/selectSensorByID.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								pkg/storage/postgres/selectSensorByID.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
SELECT
 | 
			
		||||
  sensor_id,
 | 
			
		||||
  sensor_name,
 | 
			
		||||
  sensor_location,
 | 
			
		||||
  wire_id,
 | 
			
		||||
  i2c_bus,
 | 
			
		||||
  i2c_address,
 | 
			
		||||
  gpio_number,
 | 
			
		||||
  sensor_model,
 | 
			
		||||
  sensor_enabled,
 | 
			
		||||
  device_id,
 | 
			
		||||
  creation_date
 | 
			
		||||
FROM
 | 
			
		||||
  sensors
 | 
			
		||||
WHERE
 | 
			
		||||
  sensor_id = $1;
 | 
			
		||||
		Reference in New Issue
	
	Block a user