++ed by:

4 PAUSE users
3 non-PAUSE users.

Author image Scott Smith
and 1 contributors


UR::Env - Environment variables that control UR behavior


UR uses several environment variables to change its behavior.


When true, has the effect of turning any die() into a Carp::confess, meaning a stack dump will be printed after the die message.


When true, has the effect of turning any warn() into a Carp::cluck, meaning a stack dump will be printed after the warn message.


The name of the Root context to instantiate when the program initializes. The default is UR::Context::DefaultRoot. Other Root Contexts can be used, for example, to connect to alternate databases when running in test mode.


This value only changes in a sub-process which goes to its parent process for object I/O instead of the root (which is the default value for the base context in an application).


Set the object count highwater mark for the object cache pruner. See also "object_cache_size_highwater" in UR::Context


Set the object count lowwater mark for the object cache pruner. See also "object_cache_size_lowwater" in UR::Context


When true, messages will be printed to STDERR whenever objects are removed from the object cache, such as when the object pruner marks them for removal, when they are garbage collected, unloaded, or deleted.


If this is true, most interactions with data sources such as connecting, disconnecting and querying will print messages to STDERR. Same as UR::DBI->monitor_sql(). Note that this affects non-DBI data sources as well, such as file-based data sources, which will render file I/O information instead of SQL.


Used in conjunction with UR_DBI_MONITOR_SQL, tells the data sources to also print messages to STDERR for each row fetched from the underlying data source. Same as UR::DBI->monitor_every_fetch().


Print a message to STDERR only when connecting to an underlying data source. Same as UR::DBI->dump_stack_on_connect()


If the query to a data source matches the given string (interpreted as a regex), then it will attempt to do an "explain plan" and print the results before executing the query. Same as UR::DBI->explain_sql_match()


If the time between a prepare and the first fetch of a query is longer than the given number of seconds, then it will do an "explain plan" and print the results. Same as UR::DBI->explain_sql_slow()


Used in conjunction with UR_DBI_EXPLAIN_SQL_MATCH and UR_DBI_EXPLAIN_SQL_SLOW, prints a stack trace with Carp::longmess. Same as UR::DBI->explain_sql_callstack()


Like UR_DBI_MONITOR_SQL, but only prints information during data-altering statements, like INSERT, UPDATE or DELETE. Same as UR::DBI->monitor_dml()


If true, data source commits will be ignored. Note that saving still occurs. If you are working with a RDBMS database, this means During UR::Context->commit(), the insert, update and delete SQL statements will be issued, but the changes will not be committed. Useful for testing. Same as UR::DBI->no_commit()


If true, objects created without ID params will use a special algorithm to generate IDs. Objects with these special IDs will never be saved to a data source. Useful during testing. Same as UR::DataSource->use_dummy_autogenerated_ids