put_="schema"

<do action_="sql" put_="schema" objname_="[SCHEMA]" data_="{...}"/> updates a schema with the properties contained in data_.

Description

put_="schema" updates the schema properties specified in data_, and only those properties. put_="schema" signals an error unless the caller is either an admin of the schema (the caller’s user ID or the ID of a group to which the caller belongs is listed in the schema’s admins property), or has the admin_all SQL privilege. Note that, unless the caller has the admin_all privilege, they cannot remove their own ID from the admins list (it will be re-added automatically if omitted), so as to prevent inadvertently rendering the schema inaccessible.

Syntax

<dynamic>
    <do action_="sql" put_="schema"
     objname_="[SCHEMA]"
     import_="[PATHS]"
     tablenames_="names"|"paths"|"manglepaths"|"labels"
     colnames_="labels"|"names"
     clearcache_="0"|"1"|"tables"|"columns"
     limit_="[DEPTH]"
     rename_="[NEW_NAME]"
     data_="{...}"/>
</dynamic>

Attributes for put_="schema"

objname_
The specified schema to update.
import_
[PATHS] is an optional list (or comma-separated list) of 1010 table/query pathnames. Each path is analyzed (as in analyze_="table") and a SQL table is generated. The SQL table name is, by default, the 1010data table name (last component of the path). However, if the table names in [PATHS] are not unique (the same table name appears in multiple folders) then as any components, going back from the end of the path, as necessary to disambiguate the names are used, separated by _.
tablenames_
How SQL should derive the table names. The choices are "names" (derived from 1010data table names), "paths" (derived from complete 1010data table paths), "manglepaths" (derived from the complete 1010data table paths, but with "." replaced with "_"), and "labels" (derived from 1010data table labels). tablenames_ may also take a non-comma-separated list of unique names, which must consist of valid SQL identifiers and be the same length as the list of paths. The default value is "names".
colnames_
How SQL should derive the column names from the 1010data table. The default value is "label" (use 1010data column labels). You can also use "names" (use 1010data column names).
clearcache_
Determines how often the MDB cache is cleared. A value of "1" or "tables" clears the MDB cache after each table is processed. A value of "columns" clears the MDB cache after each column is processed. A value of "0" does not clear the cache at all, and is the default value.
limit_
Specifies the row threshold at which a table is considered too long to perform exact cardinality and sortedness operations. The default value is 1,000,000,000.
rename_
The new name of the schema. This option is valid only if you have rename_schema or drop_schema privileges.
data_
The dictionary specified in data_ is the same format as returned by get_="schema" and may contain any of the following keys.
desc
Associated with a string.
users
Associated with either a list or a string containing a comma-separated list of usernames.
admins
Associated with either a list or a string containing a comma-separated list of usernames.

Additional information

The parameters for put_="schema", put_="table", or put_="column" may be specified in a package via the data_ attribute, or may be specified directly as attributes to the <do> action. For example, <do action_="sql" put_="schema" objname_=”foo” users_=”bar,baz”/> changes the user list of the schema. This is equivalent to <do action_=”sql” put_=”schema” objname_=”foo” data_=”{users:{'bar','baz'}}”/>).