Ejemplo n.º 1
0
        /// <summary>
        /// Creates the trigger table where the row count is automatically update through a custom insert and delete trigger.
        /// <para/>
        /// SQL query Example: <para/>
        /// create table if not exists tableName_count (id integer primary key, number int);
        /// </summary>
        /// <param name="tableName">The name of the table.</param>
        /// <returns>The finished sql string.</returns>
        private string CreateTriggerTable(string tableName)
        {
            SQLQueryBuilder sqb   = new SQLQueryBuilder();
            string          param = sqb.Brackets(sqb.AddValue("id").TypeInteger().ParamPrimaryKey().Comma().AddValue("rowCount").TypeInteger().Flush()).Flush();

            sqb.Create().Table().IfNotExists().AddValue(tableName + "_count").AddValue(param);
            return(sqb.ToString());
        }