Beispiel #1
0
        private long ImplementDeleteRow(
            Int64 queryId,
            Int64 sessionId,
            string rowHash,
            SQLiteConnection connection,
            SQLiteTransaction transaction = null
            )
        {
            RowDeleteCommand       deleteCommand = new RowDeleteCommand(this.Connection, this.TableDefinition);
            string                 clause        = CommonRowFiller.GetIdentClause();
            List <SQLiteParameter> parameters    = CommonRowFiller.GetIdentParameters(queryId, sessionId);

            SQLiteParameter rowHashParam = new SQLiteParameter("@rowhash", DbType.String)
            {
                Value = rowHash
            };

            clause += " AND [" + CommonRowFiller.RowHashFieldName + "] = @rowhash";

            parameters.Add(rowHashParam);

            deleteCommand.SetCommandConstraints(clause, parameters, transaction);

            return(deleteCommand.Execute(100));
        }
        public void RemoveConnections(Int64 parentQueryId)
        {
            const string parentQueryIdParamName = "@parentQueryId";
            string       strSQLClause           = null;

            if (!this.ReadOnly)
            {
                using (this.Connection.OpenWrapper())
                {
                    var deleteCommand = new RowDeleteCommand(this.Connection, this.TableDefinition);

                    strSQLClause = string.Format(
                        "[{0}] = {1}",
                        ParentQueryIdFn,
                        parentQueryIdParamName
                        );

                    var parentQueryIdParam = new SQLiteParameter(parentQueryIdParamName, DbType.Int64)
                    {
                        Value = parentQueryId
                    };

                    var parameters = new List <SQLiteParameter> {
                        parentQueryIdParam
                    };

                    deleteCommand.SetCommandConstraints(strSQLClause, parameters);

                    deleteCommand.Execute(100);
                }
            }
        }
Beispiel #3
0
        public void ClearAutoGeneratedRows(Int64 queryId, Int64 sessionId)
        {
            using (this.Connection.OpenWrapper())
            {
                RowDeleteCommand       deleteCommand = new RowDeleteCommand(this.Connection, this.TableDefinition);
                string                 clause        = CommonRowFiller.GetIdentClause();
                List <SQLiteParameter> parameters    = CommonRowFiller.GetIdentParameters(queryId, sessionId);

                deleteCommand.SetCommandConstraints(clause, parameters);

                deleteCommand.Execute(100);
            }
        }