File tree 2 files changed +12
-0
lines changed
sqliteparser/src/main/java/com/vansuita/sqliteparser 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) {
48
48
return this ;
49
49
}
50
50
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
+
51
62
/**
52
63
* Sets a String field name.
53
64
*
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public String build() {
64
64
protected static final String CREATE_TABLE = "CREATE TABLE %s (%s)" ;
65
65
protected static final String INTEGER = "INTEGER" ;
66
66
protected static final String PK = INTEGER + " PRIMARY KEY" ;
67
+ protected static final String AUTOINCREMENT = PK + " AUTOINCREMENT" ;
67
68
protected static final String TEXT = "TEXT" ;
68
69
protected static final String FLOAT = "FLOAT" ;
69
70
You can’t perform that action at this time.
0 commit comments