File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
sqliteparser/src/main/java/com/vansuita/sqliteparser Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,17 @@ public Create pk(String fieldName) {
4848 return this ;
4949 }
5050
51+ /**
52+ * Sets the primary key autoincrement field name.
53+ *
54+ * @param fieldName The name of the field
55+ * @return the same instance of {@link Create} class.
56+ */
57+ public Create pkai (String fieldName ) {
58+ fields .put (fieldName , AUTOINCREMENT );
59+ return this ;
60+ }
61+
5162 /**
5263 * Sets a String field name.
5364 *
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public String build() {
6464 protected static final String CREATE_TABLE = "CREATE TABLE %s (%s)" ;
6565 protected static final String INTEGER = "INTEGER" ;
6666 protected static final String PK = INTEGER + " PRIMARY KEY" ;
67+ protected static final String AUTOINCREMENT = PK + " AUTOINCREMENT" ;
6768 protected static final String TEXT = "TEXT" ;
6869 protected static final String FLOAT = "FLOAT" ;
6970
You can’t perform that action at this time.
0 commit comments