Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,47 @@
package leenkx.logicnode;
class DatabaseConnectNode extends LogicNode {
#if sys
public var property0: String;
public var connection: sys.db.Connection;
public function new(tree:LogicTree) {
super(tree);
}
override function run(from:Int) {
var user = inputs[1].get();
if (user == null) return;
var password = inputs[2].get();
if (password == null) return;
var socket = inputs[3].get();
var host = inputs[4].get();
if (host == null) return;
var port = inputs[5].get();
if (port == null) return;
var database = inputs[6].get();
if (database == null) return;
try {
connection = sys.db.Mysql.connect({
user: inputs[1].get(),
pass: inputs[2].get(),
socket: inputs[3].get(),
host: inputs[4].get(),
port: inputs[5].get(),
database: inputs[6].get(),
});
if(connection != null){
runOutput(0);
}
} catch(error){
trace('Error durring database connection: ' + error);
}
}
override function get(from: Int): Dynamic {
return switch (from) {
case 1: connection;
default: throw "Unreachable";
}
}
#end
}