- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class Relations
Methods (to be applied on the object)
default (scripted, public)
xo::db::require
default [ -table table ] [ -col col ] [ -value value ]Set a column default when it differs from the requested value.
- Switches:
- -table (optional)
- Table to alter.
- -col (optional)
- Column name.
- -value (optional)
- SQL default expression.
- Testcases:
- xotcl_core_tutorial_2
exists_column (scripted, public)
xo::db::require
exists_column table_name column_nameCheck whether a table contains a column.
- Parameters:
- table_name (required)
- Table to inspect.
- column_name (required)
- Column to look up.
- Returns:
- Whether the column exists.
- Testcases:
- xotcl_core_tutorial_2
exists_table (scripted)
function_args (scripted, public)
xo::db::require
function_args [ -kernel_older_than kernel_older_than ] \
[ -package_key_and_version_older_than package_key_and_version_older_than ] \
[ -check_function check_function ] sql_fileLoad the SQL file, if the kernel is older than the specified version, and the version of the specified package is older, and the check_function does not exist in function_args.
Sample usage: ::xo::db::require function_args \
-kernel_older_than 5.5.0 \
-older_than_package_key_and_version "xowiki 0.50" \
-check_function "acs_object_type__create_type" \
[acs_package_root_dir xotcl-request-broker]/patches/funcs-1.sql- Switches:
- -kernel_older_than (optional)
- -package_key_and_version_older_than (optional)
- -check_function (optional)
- Parameters:
- sql_file (required)
- Testcases:
- No testcase defined.
index (scripted, public)
xo::db::require
index [ -table table ] [ -col col ] \
[ -expression expression ] [ -expression_name expression_name ] \
[ -using using ] [ -unique unique ]Create the named-by-convention index if it is missing. Supply either a column list or an expression.
- Switches:
- -table (optional)
- Table to index.
- -col (optional)
- Comma-separated column list.
- -expression (optional)
- SQL expression to index.
- -expression_name (optional)
- Optional name component for an expression index.
- -using (optional)
- Optional index access method for PostgreSQL.
- -unique (optional, defaults to
"false") - Whether to create a unique index.
- Testcases:
- xotcl_core_tutorial_2
not_null (scripted, public)
xo::db::require
not_null [ -table table ] [ -col col ]Add a NOT NULL constraint if the column does not already have one.
- Switches:
- -table (optional)
- Table to alter.
- -col (optional)
- Column name.
- Testcases:
- xotcl_core_tutorial_2
package (scripted)
references (scripted, public)
xo::db::require
references [ -table table ] [ -col col ] [ -ref ref ]Add a foreign key if the specified relationship does not already exist.
- Switches:
- -table (optional)
- Table to alter.
- -col (optional)
- Column name.
- -ref (optional)
- Referenced table or table(column) with optional SQL clauses. A table alone must have a single-column primary key.
- Testcases:
- xotcl_core_tutorial_2
sequence (scripted)
table (scripted, public)
xo::db::require
table name definition [ populate ]Create a table if needed, or add missing columns to an existing table.
- Parameters:
- name (required)
- Table name.
- definition (required)
- Dictionary mapping column names to SQL definitions.
- populate (optional)
- Optional SQL to run after creating the table.
- Testcases:
- xotcl_core_tutorial_2
unique (scripted, public)
xo::db::require
unique [ -table table ] [ -col col ]Add a uniqueness constraint unless the column already has a matching constraint or conventionally named unique index.
- Switches:
- -table (optional)
- Table to alter.
- -col (optional)
- Column name.
- Testcases:
- xotcl_core_tutorial_2
view (scripted)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables