void PrepareInsert(string fileName) { lock (Lock) { SqliteCommand insert = Connection.CreateCommand(); insert.CommandText = "INSERT INTO " + TableName(fileName) + " (OFFSET, USR, ISDEF) VALUES (@OFFSET, @USR, @ISDEF);"; insert.CommandType = CommandType.Text; insert.Prepare(); InsertCommands.Add(fileName, insert); } }
void HandleRemoval(object sender, ProjectFileEventArgs args) { lock (Lock) { foreach (var e in args) { using (var cmd = Connection.CreateCommand()) { cmd.CommandText = "DROP TABLE " + TableName(e.ProjectFile.Name) + ";"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } InsertCommands.Remove(e.ProjectFile.Name); } } }
public Commands(Connection conn) { File = new FileCommands(conn); Insert = new InsertCommands(conn); }