add first json db functions

This commit is contained in:
2023-08-15 10:42:24 +02:00
parent 1beba0131a
commit 3e7ff741a3
5 changed files with 39 additions and 31 deletions

View File

@@ -20,12 +20,20 @@ class SQLDB {
}
connect ( ) {
const self = this;
this.sqlConnection.connect( function( err ) {
if ( err ) {
console.error( '[ SQL ]: An error ocurred whilst connecting: ' + err.stack );
return;
}
console.log( '[ SQL ] Connected to database successfully' );
self.sqlConnection.query( 'TRUNCATE libreevent_temp;', error => {
if ( error ) {
console.error( '[ SQL ] Unable to truncate libreevent_temp table due to the following error: ' + error.code );
} else {
console.log( '[ SQL ] Truncated temporary data table successfully' );
}
} );
return 'connection';
} );
}