SQLite Database


Node Information
Creates or opens a SQLite database file, you can either specify the database file, or you use your own custom query.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
CreateOpen IN RUN MULTIPLE FALSE FALSE
File IN String ONE FALSE FALSE
CustomQuery IN String ONE FALSE FALSE
Database OUT Object MULTIPLE FALSE FALSE
TableNames OUT List<String> MULTIPLE TRUE FALSE

Source
namespace Korduene.KGraph.Nodes.Database.SQLite
{
    [IsNode("Create/Open")]
    public class CreateOpen : Node
    {
        Port create = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "CreateOpen");
        Port file = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "File");
        Port qq = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "CustomQuery");
        Port db = new Port(PortType.OUT, typeof(object), AcceptsLinks.MULTIPLE, "Database");
        Port tablenames = new Port(PortType.OUT, typeof(List<string>), AcceptsLinks.MULTIPLE, "TableNames");
        Variable var1 = new Variable("Korduene.Database.SQLite.SQLiteManager", string.Empty);
        public CreateOpen()
        {
            NodeType = KGraph.NodeType.Method;
            Name = "SQLite Database";
            Dependency = DependencyLibraries.SQLITE;
            Variables.Add(var1);
            AddPort(create);
            AddPort(file);
            AddPort(qq);
            AddPort(db);
            AddPort(tablenames);
            Information = "Creates or opens a SQLite database file, you can either specify the database file, or you use your own custom query.";
        }
        public override string Code()
        {
            var1.Name = db.ID;
            db.Instructions = var1.Name;
            tablenames.Instructions = var1.Name + ".GetTableNames()";
            var1.Initialize = "null";
            return var1.Name + " = new Korduene.Database.SQLite.SQLiteManager(" + GetValue(file) + "," + GetValue(qq) + ");";
        }
    }
}