diff --git a/core/database/table_builder.cpp b/core/database/table_builder.cpp index 1ae2d95..912e2f1 100644 --- a/core/database/table_builder.cpp +++ b/core/database/table_builder.cpp @@ -21,6 +21,27 @@ TableBuilder *TableBuilder::tiny_integer(const String &name, const int length) { return this; } +TableBuilder *TableBuilder::small_integer(const String &name) { + return this; +} +TableBuilder *TableBuilder::small_integer(const String &name, const int length) { + return this; +} + +TableBuilder *TableBuilder::real_float(const String &name) { + return this; +} +TableBuilder *TableBuilder::real_float(const String &name, const int size, const int d) { + return this; +} + +TableBuilder *TableBuilder::real_double(const String &name) { + return this; +} +TableBuilder *TableBuilder::real_double(const String &name, const int size, const int d) { + return this; +} + TableBuilder *TableBuilder::date(const String &name) { return this; } diff --git a/core/database/table_builder.h b/core/database/table_builder.h index 081ad57..cc70f23 100644 --- a/core/database/table_builder.h +++ b/core/database/table_builder.h @@ -17,6 +17,15 @@ public: virtual TableBuilder *tiny_integer(const String &name); virtual TableBuilder *tiny_integer(const String &name, const int length); + virtual TableBuilder *small_integer(const String &name); + virtual TableBuilder *small_integer(const String &name, const int length); + + virtual TableBuilder *real_float(const String &name); + virtual TableBuilder *real_float(const String &name, const int size, const int d); + + virtual TableBuilder *real_double(const String &name); + virtual TableBuilder *real_double(const String &name, const int size, const int d); + virtual TableBuilder *date(const String &name); virtual TableBuilder *varchar(const String &name, const int length); virtual TableBuilder *not_null(); diff --git a/database/sqlite/sqlite3_table_builder.cpp b/database/sqlite/sqlite3_table_builder.cpp index 435862a..3d8b1e8 100644 --- a/database/sqlite/sqlite3_table_builder.cpp +++ b/database/sqlite/sqlite3_table_builder.cpp @@ -24,7 +24,7 @@ TableBuilder *SQLite3TableBuilder::integer(const String &name, const int length) } TableBuilder *SQLite3TableBuilder::tiny_integer(const String &name) { - result += name + " INTEGER "; + result += name + " INTEGER(4) "; return this; } @@ -33,6 +33,40 @@ TableBuilder *SQLite3TableBuilder::tiny_integer(const String &name, const int le result += String::num(length); result += ") "; + return this; +} + +TableBuilder *SQLite3TableBuilder::small_integer(const String &name) { + result += name + " INTEGER(6) "; + + return this; +} +TableBuilder *SQLite3TableBuilder::small_integer(const String &name, const int length) { + result += name + " INTEGER("; + result += String::num(length); + result += ") "; + + return this; +} + +TableBuilder *SQLite3TableBuilder::real_float(const String &name) { + result += name + " FLOAT "; + + return this; +} +TableBuilder *SQLite3TableBuilder::real_float(const String &name, const int size, const int d) { + result += name + " FLOAT "; + + return this; +} + +TableBuilder *SQLite3TableBuilder::real_double(const String &name) { + result += name + " DOUBLE "; + + return this; +} +TableBuilder *SQLite3TableBuilder::real_double(const String &name, const int size, const int d) { + result += name + " DOUBLE "; return this; } diff --git a/database/sqlite/sqlite3_table_builder.h b/database/sqlite/sqlite3_table_builder.h index 124fb24..245b370 100644 --- a/database/sqlite/sqlite3_table_builder.h +++ b/database/sqlite/sqlite3_table_builder.h @@ -17,6 +17,15 @@ public: TableBuilder *tiny_integer(const String &name); TableBuilder *tiny_integer(const String &name, const int length); + TableBuilder *small_integer(const String &name); + TableBuilder *small_integer(const String &name, const int length); + + TableBuilder *real_float(const String &name); + TableBuilder *real_float(const String &name, const int size, const int d); + + TableBuilder *real_double(const String &name); + TableBuilder *real_double(const String &name, const int size, const int d); + TableBuilder *date(const String &name); TableBuilder *varchar(const String &name, const int length); TableBuilder *not_null();