LibSQL: Support BOOLEAN column types in the CREATE TABLE command

The database already supports BOOLEAN, this just hooks up the executor
as well.
This commit is contained in:
Timothy Flynn 2022-10-27 09:05:16 -04:00 committed by Linus Groh
parent 3821f35e4e
commit 8f3c22718e
Notes: sideshowbarker 2024-07-17 05:02:42 +09:00

View file

@ -35,6 +35,8 @@ ResultOr<ResultSet> CreateTable::execute(ExecutionContext& context) const
type = SQLType::Integer;
else if (column.type_name()->name().is_one_of("FLOAT"sv, "NUMBER"sv))
type = SQLType::Float;
else if (column.type_name()->name().is_one_of("BOOL"sv, "BOOLEAN"sv))
type = SQLType::Boolean;
else
return Result { SQLCommand::Create, SQLErrorCode::InvalidType, column.type_name()->name() };