Execute a query. To execute a query in the REPL, terminate the statement with a semicolon and press “ENTER”.
db>
select 5;
{5}
Alternatively, you can run the query without a semicolon by hitting Alt-Enter on Windows/Linux, or Esc+Return on macOS.
db>
select 5
{5}
Use query parameters. If your query contains a parameter, you will be prompted for a value.
db>
select 5 + <int64>$num;
Parameter <int64>$num: 6 {11}
List databases:
db>
\l
List of databases: db tutorial
Connect to a database:
db>
\c my_new_project
my_new_project>
List modules:
db>
\lm
List object types:
db>
\lt
List scalar types:
db>
\ls
List expression aliases (the -v
includes the expression value in
the listing):
db>
\la -v
Describe an object type:
db>
\d object Object
abstract type std::Object extending std::BaseObject { required single link __type__ -> schema::Type { readonly := true; }; required single property id -> std::uuid { readonly := true; }; };
Describe a scalar type:
db>
\d object decimal
scalar type std::decimal extending std::anynumeric;
Describe a function:
db>
\d object sum
function std::sum(s: set of std::bigint) -> std::bigint { volatility := 'Immutable'; annotation std::description := 'Return the sum of the set of numbers.'; using sql function 'sum' ;}; function std::sum(s: set of std::int32) -> std::int64 { volatility := 'Immutable'; annotation std::description := 'Return the sum of the set of numbers.'; using sql function 'sum' ;}; function std::sum(s: set of std::decimal) -> std::decimal { volatility := 'Immutable'; annotation std::description := 'Return the sum of the set of numbers.'; using sql function 'sum' ;}; function std::sum(s: set of std::float32) -> std::float32 { volatility := 'Immutable'; annotation std::description := 'Return the sum of the set of numbers.'; using sql function 'sum' ;}; function std::sum(s: set of std::int64) -> std::int64 { volatility := 'Immutable'; annotation std::description := 'Return the sum of the set of numbers.'; using sql function 'sum' ;}; function std::sum(s: set of std::float64) -> std::float64 { volatility := 'Immutable'; annotation std::description := 'Return the sum of the set of numbers.'; using sql function 'sum' ;};