SQLite Update Rows


Node Information
Updates rows in the specified table with the specified name from the specified SQLite database.
General Information
• This node doesn't have other available options.
• Some of the ports of this node can change their types and accept types automatically.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Update IN RUN MULTIPLE FALSE FALSE
Database IN Object ONE FALSE FALSE
TableName IN String ONE FALSE FALSE
ColumnName IN String ONE FALSE FALSE
Equals IN String ONE FALSE FALSE
Rows IN SQLiteRow ONE FALSE TRUE

Source
namespace Korduene.KGraph.Nodes.Database.SQLite
{
    [IsNode("Update Rows")]
    public class UpdateRow : Node
    {
        Port create = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Update");
        Port db = new Port(PortType.IN, typeof(object), AcceptsLinks.ONE, "Database");
        Port tname = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "TableName");
        Port colname = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "ColumnName");
        Port eq = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Equals");
        Port row = new Port(PortType.IN, typeof(Korduene.Database.SQLite.SQLiteRow), AcceptsLinks.ONE, "Rows");
        public UpdateRow()
        {
            NodeType = KGraph.NodeType.Method;
            Name = "SQLite Update Rows";
            Dependency = DependencyLibraries.SQLITE;
            AddPort(create);
            AddPort(db);
            AddPort(tname);
            AddPort(colname);
            AddPort(eq);
            AddPort(row);
            row.CustomAcception = Accepts;
            Information = "Updates rows in the specified table with the specified name from the specified SQLite database.";
        }
        bool Accepts(Port port)
        {
            if (port.DataType == typeof(List<korduene.database.sqlite.sqliterow>))
            {
                row.DataType = typeof(List<korduene.database.sqlite.sqliterow>);
                row.Accepts = AcceptsLinks.ONE;
                return true;
            }
            if (port.DataType == typeof(Korduene.Database.SQLite.SQLiteRow))
            {
                row.DataType = typeof(Korduene.Database.SQLite.SQLiteRow);
                row.Accepts = AcceptsLinks.MULTIPLE;
                return true;
            }
            return false;
        }
        public override string Code()
        {
            string code = string.Empty;
            if (row.Accepts == AcceptsLinks.ONE)
            {
                code = GetValue(db) + ".UpdateRow(" + GetValue(tname) + ", " + GetValue(row) + ", " + GetValue(colname) + ", " + GetValue(eq) + ");";
            }
            else
            {
                code = GetValue(db) + ".UpdateRows(" + GetValue(tname) + ", " + GetValue(row) + ", " + GetValue(colname) + ", " + GetValue(eq) + ");";
            }
            return code;
        }
    }
}

</korduene.database.sqlite.sqliterow></korduene.database.sqlite.sqliterow>