package lama.sqlite3.gen;

import java.sql.Connection;

import lama.Query;
import lama.QueryAdapter;
import lama.StateToReproduce;

/**
 * @see https://www.sqlite.org/lang_reindex.html
 */
public class SQLite3ReindexGenerator {

	// only works for the main schema
	public static Query executeReindex(Connection con, StateToReproduce state) {
		return new QueryAdapter("REINDEX;");
	}
}

@@ -106,32 +106,96 @@
 rt lama.
-StateToReproduce
+Randomly;%0Aimport lama.StateToReproduce;%0Aimport lama.sqlite3.schema.SQLite3Schema
 ;%0A%0A/**%0A 
@@ -399,11 +399,269 @@
 tate
-) %7B
+, SQLite3Schema s) %7B%0A%09%09StringBuilder sb = new StringBuilder(%22REINDEX%22);%0A%09%09if (Randomly.getBoolean()) %7B%0A%09%09%09sb.append(%22 %22);%0A%09%09%09sb.append(s.getRandomTable().getName());%0A%09%09%7D else %7B%0A%09%09%09sb.append(Randomly.fromOptions(%22BINARY%22, %22NOCASE%22, %22RTRIM%22));%0A%09%09%7D%0A%09%09// TODO index
 %0A%09%09r
@@ -696,13 +696,14 @@
 DEX;%22);%0A
+%0A
 %09%7D%0A%7D%0A

Extend REINDEX