1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:45:10 +00:00
serenity/Userland/Libraries/LibSQL
Timothy Flynn 2397836f8e LibSQL+SQLServer: Introduce and use ResultOr<ValueType>
The result of a SQL statement execution is either:
    1. An error.
    2. The list of rows inserted, deleted, selected, etc.

(2) is currently represented by a combination of the Result class and
the ResultSet list it holds. This worked okay, but issues start to
arise when trying to use Result in non-statement contexts (for example,
when introducing Result to SQL expression execution).

What we really need is for Result to be a thin wrapper that represents
both (1) and (2), and to not have any explicit members like a ResultSet.
So this commit removes ResultSet from Result, and introduces ResultOr,
which is just an alias for AK::ErrorOrr. Statement execution now returns
ResultOr<ResultSet> instead of Result. This further opens the door for
expression execution to return ResultOr<Value> in the future.

Lastly, this moves some other context held by Result over to ResultSet.
This includes the row count (which is really just the size of ResultSet)
and the command for which the result is for.
2022-02-10 23:11:13 +01:00
..
AST LibSQL+SQLServer: Introduce and use ResultOr<ValueType> 2022-02-10 23:11:13 +01:00
BTree.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
BTree.h LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
BTreeIterator.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
CMakeLists.txt LibSQL+SQLServer: Move LibSQL/SQLResult.[h,cpp] to LibSQL/Result.[h,cpp] 2022-02-10 12:20:35 +00:00
Database.cpp LibSQL: Implement a DESCRIBE TABLE statement 2022-02-05 00:35:03 +01:00
Database.h LibSQL: Implement a DESCRIBE TABLE statement 2022-02-05 00:35:03 +01:00
Forward.h LibSQL+SQLServer: Introduce and use ResultOr<ValueType> 2022-02-10 23:11:13 +01:00
HashIndex.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
HashIndex.h LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Heap.cpp Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr 2022-01-24 22:36:09 +01:00
Heap.h LibSQL: Improve error handling 2021-12-04 20:49:22 +03:30
Index.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Index.h LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Key.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Key.h LibSQL: Resolve cyclic dependency 2021-10-06 23:52:40 +01:00
Meta.cpp LibSQL: Add 'schema' and 'table' to TupleElementDescriptor 2021-11-10 14:47:49 +01:00
Meta.h LibSQL: Do not return copies of vectors from table/index definitions 2022-02-10 12:20:35 +00:00
Result.cpp LibSQL+SQLServer: Introduce and use ResultOr<ValueType> 2022-02-10 23:11:13 +01:00
Result.h LibSQL+SQLServer: Introduce and use ResultOr<ValueType> 2022-02-10 23:11:13 +01:00
ResultSet.cpp LibSQL+SQLServer: Introduce and use ResultOr<ValueType> 2022-02-10 23:11:13 +01:00
ResultSet.h LibSQL+SQLServer: Introduce and use ResultOr<ValueType> 2022-02-10 23:11:13 +01:00
Row.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Row.h LibSQL: Resolve cyclic dependency 2021-10-06 23:52:40 +01:00
Serializer.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Serializer.h LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
SQLClient.cpp SQLServer+SQL+LibSQL: Allow sql client to specify the database name 2021-10-05 02:22:19 +02:00
SQLClient.h LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer 2022-01-15 13:29:48 +03:30
TreeNode.cpp LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00
Tuple.cpp LibSQL: Add the 'extend' operation to the Tuple class 2021-11-10 14:47:49 +01:00
Tuple.h LibSQL: Add the 'extend' operation to the Tuple class 2021-11-10 14:47:49 +01:00
TupleDescriptor.h LibSQL: Add 'schema' and 'table' to TupleElementDescriptor 2021-11-10 14:47:49 +01:00
Type.h LibSQL: Allow expressions and column names in SELECT ... FROM 2021-10-05 02:22:19 +02:00
Value.cpp LibSQL: Avoid signed arithmetic in IntegerImpl::compare 2022-02-05 00:35:03 +01:00
Value.h LibSQL: Add 'schema' and 'table' to TupleElementDescriptor 2021-11-10 14:47:49 +01:00
ValueImpl.h LibSQL: Introduce Serializer as a mediator between Heap and client code 2021-08-21 22:03:30 +02:00