diff --git a/src/SQLite.cs b/src/SQLite.cs index edd287239..62b3e8c3c 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -871,6 +871,33 @@ public SQLiteCommand CreateCommand (string cmdText, params object[] ps) return cmd; } + /// + /// Creates a new SQLiteCommand given the command text with arguments. Place a "[@:]VVV" + /// in the command text for each of the arguments. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of "[@:]VVV" in the command text. + /// + /// + /// A + /// + public SQLiteCommand CreateCommand(string cmdText, Dictionary args) + { + if (!this._open) + throw SQLiteException.New(SQLite3.Result.Error, "Cannot create commands from unopened database"); + + SQLiteCommand cmd = NewCommand(); + cmd.CommandText = cmdText; + foreach (var kv in args) + { + cmd.Bind(kv.Key, kv.Value); + } + return cmd; + } + /// /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' /// in the command text for each of the arguments and then executes that command.