Add support for MySQL auto_increment offset (#950)

This commit is contained in:
ehoeve 2023-08-21 22:25:32 +02:00 committed by GitHub
parent 41e47cc013
commit 9500649c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 0 deletions

View file

@ -66,6 +66,7 @@ pub struct CreateTableBuilder {
pub clone: Option<ObjectName>,
pub engine: Option<String>,
pub comment: Option<String>,
pub auto_increment_offset: Option<u32>,
pub default_charset: Option<String>,
pub collation: Option<String>,
pub on_commit: Option<OnCommit>,
@ -98,6 +99,7 @@ impl CreateTableBuilder {
clone: None,
engine: None,
comment: None,
auto_increment_offset: None,
default_charset: None,
collation: None,
on_commit: None,
@ -204,6 +206,11 @@ impl CreateTableBuilder {
self
}
pub fn auto_increment_offset(mut self, offset: Option<u32>) -> Self {
self.auto_increment_offset = offset;
self
}
pub fn default_charset(mut self, default_charset: Option<String>) -> Self {
self.default_charset = default_charset;
self
@ -257,6 +264,7 @@ impl CreateTableBuilder {
clone: self.clone,
engine: self.engine,
comment: self.comment,
auto_increment_offset: self.auto_increment_offset,
default_charset: self.default_charset,
collation: self.collation,
on_commit: self.on_commit,
@ -296,6 +304,7 @@ impl TryFrom<Statement> for CreateTableBuilder {
clone,
engine,
comment,
auto_increment_offset,
default_charset,
collation,
on_commit,
@ -324,6 +333,7 @@ impl TryFrom<Statement> for CreateTableBuilder {
clone,
engine,
comment,
auto_increment_offset,
default_charset,
collation,
on_commit,