mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:17:35 +00:00
LibSQL: Added 'nullable' and 'default value' option to ColumnDef
These are standard SQL concepts which columns should be aware of.
This commit is contained in:
parent
b74721e604
commit
230118c4b2
2 changed files with 14 additions and 0 deletions
|
@ -74,6 +74,11 @@ public:
|
|||
Key key() const override;
|
||||
SQLType type() const { return m_type; }
|
||||
size_t column_number() const { return m_index; }
|
||||
void set_not_null(bool can_not_be_null) { m_not_null = can_not_be_null; }
|
||||
bool not_null() const { return m_not_null; }
|
||||
void set_default_value(Value const& default_value);
|
||||
Value const& default_value() const { return m_default; }
|
||||
|
||||
static NonnullRefPtr<IndexDef> index_def();
|
||||
static Key make_key(TableDef const&);
|
||||
|
||||
|
@ -83,6 +88,8 @@ protected:
|
|||
private:
|
||||
size_t m_index;
|
||||
SQLType m_type { SQLType::Text };
|
||||
bool m_not_null { false };
|
||||
Value m_default;
|
||||
};
|
||||
|
||||
class KeyPartDef : public ColumnDef {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue