File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,26 @@ private void SetJournalMode() =>
122122 /// </summary>
123123 public JsonSerializerOptions ? JsonOptions { get ; set ; }
124124
125+ /// <summary>
126+ /// Deletes all rows from a table.
127+ /// </summary>
128+ public void Clear ( )
129+ {
130+ sqlite3_exec ( db , $ "DELETE FROM { Table } ;") ;
131+ }
132+
133+ /// <summary>
134+ /// Drops the table and then Creates it again. This will delete all indexes views etc.
135+ /// </summary>
136+ /// <remarks>See <see href="https://sqlite.org/lang_droptable.html"/> for more info.</remarks>
137+ public void DropAndCreate ( )
138+ {
139+ sqlite3_exec ( db , $ "DROP TABLE IF EXISTS { Table } ;") ;
140+ var result = CreateTable ( ) ;
141+
142+ db . CheckResult ( result , $ "Could not create '{ Table } ' database table") ;
143+ }
144+
125145 #region Find
126146
127147 private readonly Lazy < SQLiteStmt > existsStmt ;
You can’t perform that action at this time.
0 commit comments