return new c_base_return_false();
}
- $action = NULL;
+ $value = NULL;
if ($this->action === e_database_action::OWNER_TO) {
if (isset($this->owner_to)) {
- $action = $this->p_do_build_owner_to();
+ $value = $this->p_do_build_owner_to();
}
else {
- unset($action);
+ unset($value);
return new c_base_return_false();
}
}
else if ($this->action === e_database_action::RENAME_TO) {
if (isset($this->rename_to)) {
- $action = $this->p_do_build_rename_to();
+ $value = $this->p_do_build_rename_to();
}
else {
- unset($action);
+ unset($value);
return new c_base_return_false();
}
}
else {
if (is_array($this->handler)) {
- $action .= ' ' . $this->p_do_build_handler();
+ $value .= ' ' . $this->p_do_build_handler();
}
if (is_array($this->validator)) {
- $action .= ' ' . $this->p_do_build_validator();
+ $value .= ' ' . $this->p_do_build_validator();
}
- $actions .= ' ' . $this->p_do_build_options();
+ $value .= ' ' . $this->p_do_build_options();
}
$this->value = static::p_QUERY_COMMAND;
$this->value .= ' ' . $this->p_do_build_name();
- $this->value .= ' ' . $action;
- unset($action);
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
require_once('common/database/traits/database_name.php');
require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
require_once('common/database/traits/database_set_schema.php');
-require_once('common/database/traits/database_using.php');
+require_once('common/database/traits/database_using_index_method.php');
/**
class c_database_alter_operator_class extends c_database_query {
use t_database_name;
use t_database_owner_to;
+ use t_database_rename_to;
use t_database_set_schema;
- use t_database_using;
+ use t_database_using_index_method;
protected const p_QUERY_COMMAND = 'alter operator class';
*/
public function __construct() {
parent::__construct();
+
+ $this->name = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
+ $this->set_schema = NULL;
+ $this->using_index_method = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->name);
+ unset($this->owner_to);
+ unset($this->rename_to);
+ unset($this->set_schema);
+ unset($this->using_index_method);
+
parent::__destruct();
}
return new c_base_return_false();
}
- $value = $this->p_do_build_name() . ' ' . $this->p_do_build_using();
+ $value = $this->p_do_build_name() . ' ' . $this->p_do_build_using_index_method();
if (isset($this->set_schema)) {
$value .= ' ' . $this->p_do_build_set_schema();
}
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
else if (isset($this->owner_to)) {
$value .= ' ' . $this->p_do_build_owner_to();
}
require_once('common/database/classes/database_query.php');
+require_once('common/database/traits/database_add_operator_family.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_set_schema.php');
+require_once('common/database/traits/database_using_index_method.php');
+
/**
- * The class for building and returning a Postgresql ALTER COALATION query string.
+ * The class for building and returning a Postgresql ALTER OPERATOR FAMILY query string.
*
- * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ * @see: https://www.postgresql.org/docs/current/static/sql-alteroperatofamily.html
*/
-class c_database_alter_coalation extends c_database_query {
- protected const p_QUERY_COMMAND = 'alter coalation';
+class c_database_alter_operator_family extends c_database_query {
+ use t_database_add_operator_family;
+ use t_database_name;
+ use t_database_owner_to;
+ use t_database_rename_to;
+ use t_database_set_schema;
+ use t_database_using_index_method;
+
+ protected const p_QUERY_COMMAND = 'alter operator family';
/**
*/
public function __construct() {
parent::__construct();
+
+ $this->add_operator_family = NULL;
+ $this->name = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
+ $this->set_schema = NULL;
+ $this->using_index_method = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->add_operator_family);
+ unset($this->name);
+ unset($this->owner_to);
+ unset($this->rename_to);
+ unset($this->set_schema);
+ unset($this->using_index_method);
+
parent::__destruct();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name) || !isset($this->using)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name() . ' ' . $this->p_do_build_using_index_method();
+ if (isset($this->add_operator_family)) {
+ $value .= ' ' . $this->p_do_build_add_operator_family();
+ }
+ else if (isset($this->set_schema)) {
+ $value .= ' ' . $this->p_do_build_set_schema();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
- // @todo
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
<?php
/**
* @file
- * Provides a class for specific Postgesql query: ALTER COALATION.
+ * Provides a class for specific Postgesql query: ALTER POLICY.
*/
namespace n_koopa;
require_once('common/database/classes/database_query.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_on_table.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_to_role.php');
+require_once('common/database/traits/database_using_expression.php');
+require_once('common/database/traits/database_with_check.php');
+
/**
- * The class for building and returning a Postgresql ALTER COALATION query string.
+ * The class for building and returning a Postgresql ALTER POLICY query string.
*
- * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterpolicy.html
*/
-class c_database_alter_coalation extends c_database_query {
- protected const p_QUERY_COMMAND = 'alter coalation';
+class c_database_alter_policy extends c_database_query {
+ use t_database_name;
+ use t_database_on_table;
+ use t_database_rename_to;
+ use t_database_to_role;
+ use t_database_using_expression;
+ use t_database_with_check_expression;
+
+ protected const p_QUERY_COMMAND = 'alter policy';
/**
*/
public function __construct() {
parent::__construct();
+
+ $this->name = NULL;
+ $this->on_table = NULL;
+ $this->rename_to = NULL;
+ $this->to_role = NULL;
+ $this->using_expression = NULL;
+ $this->with_check_expression = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->name);
+ unset($this->on_table);
+ unset($this->rename_to);
+ unset($this->to_role);
+ unset($this->using_expression);
+ unset($this->with_check_expression);
+
parent::__destruct();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name) || !isset($this->on_table)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name() . ' ' . $this->p_do_build_on_table();
+ if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else if (isset($this->to_role)) {
+ $value .= ' ' . $this->p_do_build_to_role();
+
+ if (isset($this->using_expression)) {
+ $value .= ' ' . $this->p_do_build_using_expression();
+ }
+
+ if (isset($this->with_check_expression)) {
+ $value .= ' ' . $this->p_do_build_with_check_expression();
+ }
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
- // @todo
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
<?php
/**
* @file
- * Provides a class for specific Postgesql query: ALTER COALATION.
+ * Provides a class for specific Postgesql query: ALTER PUBLICATION.
*/
namespace n_koopa;
require_once('common/database/classes/database_query.php');
+require_once('common/database/traits/database_add_table.php');
+require_once('common/database/traits/database_drop_table.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_set_table.php');
+
/**
- * The class for building and returning a Postgresql ALTER COALATION query string.
+ * The class for building and returning a Postgresql ALTER PUBLICATION query string.
*
- * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterpublication.html
*/
-class c_database_alter_coalation extends c_database_query {
- protected const p_QUERY_COMMAND = 'alter coalation';
+class c_database_alter_publication extends c_database_query {
+ use t_database_add_table;
+ use t_database_drop_table;
+ use t_database_name;
+ use t_database_owner_to;
+ use t_database_rename_to;
+ use t_database_set_table;
+
+ protected const p_QUERY_COMMAND = 'alter publication';
/**
*/
public function __construct() {
parent::__construct();
+
+ $this->add_table = NULL;
+ $this->drop_table = NULL;
+ $this->name = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
+ $this->set_table = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->add_table);
+ unset($this->drop_table);
+ unset($this->name);
+ unset($this->owner_to);
+ unset($this->rename_to);
+ unset($this->set_table);
+
parent::__destruct();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+
+
+ if (isset($this->add_table)) {
+ $value .= ' ' . $this->p_do_build_add_table();
+ }
+ else if (isset($this->drop_table)) {
+ $value .= ' ' . $this->p_do_build_drop_table();
+ }
+ else if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else if (isset($this->set_table)) {
+ $value .= ' ' . $this->p_do_build_set_table();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
- // @todo
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
<?php
/**
* @file
- * Provides a class for specific Postgesql query: ALTER COALATION.
+ * Provides a class for specific Postgesql query: ALTER ROLE.
*/
namespace n_koopa;
require_once('common/database/classes/database_query.php');
+require_once('common/database/traits/database_in_database.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_reset.php');
+require_once('common/database/traits/database_role_specification.php');
+require_once('common/database/traits/database_set.php');
+require_once('common/database/traits/database_with_role_option.php');
+
/**
- * The class for building and returning a Postgresql ALTER COALATION query string.
+ * The class for building and returning a Postgresql ALTER ROLE query string.
*
- * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterrole.html
*/
-class c_database_alter_coalation extends c_database_query {
- protected const p_QUERY_COMMAND = 'alter coalation';
+class c_database_alter_role extends c_database_query {
+ use t_database_in_database;
+ use t_database_name;
+ use t_database_rename_to;
+ use t_database_reset;
+ use t_database_role_option;
+ use t_database_role_specification;
+ use t_database_set;
+
+ protected const p_QUERY_COMMAND = 'alter role';
/**
*/
public function __construct() {
parent::__construct();
+
+ $this->in_database = NULL;
+ $this->name = NULL;
+ $this->rename = NULL;
+ $this->reset = NULL;
+ $this->role_specification = NULL;
+ $this->set = NULL;
+ $this->with_role_option = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->in_database);
+ unset($this->name);
+ unset($this->rename);
+ unset($this->reset);
+ unset($this->role_specification);
+ unset($this->set);
+ unset($this->with_role_option);
+
parent::__destruct();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->role_specification) && is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ if (isset($this->role_specification)) {
+ $value = $this->p_do_build_role_specification();
+
+ if (isset($this->with_role_option)) {
+ $value .= ' ' . $this->p_do_build_with_role_option();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
+
+ if (isset($this->in_database)) {
+ $value .= ' ' . $this->p_do_build_in_database();
+ }
+
+ if (isset($this->set)) {
+ $value .= ' ' . $this->p_do_build_set();
+ }
+ else if (isset($this->reset)) {
+ $value .= ' ' . $this->p_do_build_reset();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
+ }
+ else if (isset($this->rename_to)) {
+ $value = $this->p_do_build_name();
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
- // @todo
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
require_once('common/database/classes/database_query.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_on_table.php');
+require_once('common/database/traits/database_rename_to.php');
+
/**
- * The class for building and returning a Postgresql ALTER COALATION query string.
+ * The class for building and returning a Postgresql ALTER RULE query string.
*
- * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterrule.html
*/
-class c_database_alter_coalation extends c_database_query {
- protected const p_QUERY_COMMAND = 'alter coalation';
+class c_database_alter_rule extends c_database_query {
+ use t_database_name;
+ use t_database_on_table;
+ use t_database_rename_to;
+
+ protected const p_QUERY_COMMAND = 'alter rule';
/**
*/
public function __construct() {
parent::__construct();
+
+ $this->name = NULL;
+ $this->on_table = NULL;
+ $this->rename_to = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->name);
+ unset($this->on_table);
+ unset($this->rename_to);
+
parent::__destruct();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name) || is_null($this->on_table) || is_null($this->rename_to)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $this->p_do_build_name();
+ $this->value .= ' ' . $this->p_do_build_on_table();
+ $this->value .= ' ' . $this->p_do_build_rename_to();
return new c_base_return_true();
}
require_once('common/database/classes/database_query.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
+
/**
- * The class for building and returning a Postgresql ALTER COALATION query string.
+ * The class for building and returning a Postgresql ALTER SCHEMA query string.
*
- * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterschema.html
*/
-class c_database_alter_coalation extends c_database_query {
- protected const p_QUERY_COMMAND = 'alter coalation';
+class c_database_alter_schema extends c_database_query {
+ use t_database_name;
+ use t_database_owner_to;
+ use t_database_rename_to;
+
+ protected const p_QUERY_COMMAND = 'alter schema';
/**
*/
public function __construct() {
parent::__construct();
+
+ $this->name = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
+ unset($this->name);
+ unset($this->owner_to);
+ unset($this->rename_to);
+
parent::__destruct();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+ if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
- // @todo
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a class for specific Postgesql query: ALTER COALATION.
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_query.php');
+
+require_once('common/database/traits/database_as_data_type.php');
+require_once('common/database/traits/database_cache.php');
+require_once('common/database/traits/database_cycle.php');
+require_once('common/database/traits/database_if_exists.php');
+require_once('common/database/traits/database_increment_by.php');
+require_once('common/database/traits/database_max_value.php');
+require_once('common/database/traits/database_min_value.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owned_by.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_restart_with.php');
+require_once('common/database/traits/database_set_schema.php');
+require_once('common/database/traits/database_start_with.php');
+
+
+/**
+ * The class for building and returning a Postgresql ALTER SEQUENCE query string.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-altersequence.html
+ */
+class c_database_alter_sequence extends c_database_query {
+ use t_database_as_data_type;
+ use t_database_cache;
+ use t_database_cycle;
+ use t_database_if_exists;
+ use t_database_increment_by;
+ use t_database_max_value;
+ use t_database_min_value;
+ use t_database_name;
+ use t_database_owned_by;
+ use t_database_owner_to;
+ use t_database_rename_to;
+ use t_database_restart_with;
+ use t_database_set_schema;
+ use t_database_start_with;
+
+ protected const p_QUERY_COMMAND = 'alter sequence';
+
+
+ /**
+ * Class constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+
+ $this->as_data_type = NULL;
+ $this->cache = NULL;
+ $this->cycle = NULL;
+ $this->if_exists = NULL;
+ $this->increment_by = NULL;
+ $this->max_value = NULL;
+ $this->min_value = NULL;
+ $this->name = NULL;
+ $this->owned_by = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
+ $this->restart_with = NULL;
+ $this->set_schema = NULL;
+ $this->start_with = NULL;
+ }
+
+ /**
+ * Class destructor.
+ */
+ public function __destruct() {
+ unset($this->as_data_type);
+ unset($this->cache);
+ unset($this->cycle);
+ unset($this->if_exists);
+ unset($this->increment_by);
+ unset($this->max_value);
+ unset($this->min_value);
+ unset($this->name);
+ unset($this->owned_by);
+ unset($this->owner_to);
+ unset($this->rename_to);
+ unset($this->restart_with);
+ unset($this->set_schema);
+ unset($this->start_with);
+
+ parent::__destruct();
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_new()
+ */
+ public static function s_new($value) {
+ return self::p_s_new($value, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_value()
+ */
+ public static function s_value($return) {
+ return self::p_s_value($return, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value_exact::p_s_value_exact()
+ */
+ public static function s_value_exact($return) {
+ return self::p_s_value_exact($return, __CLASS__, '');
+ }
+
+ /**
+ * Implements do_build().
+ */
+ public function do_build() {
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+ if (isset($this->if_exists)) {
+ $value = $this->p_do_build_if_exists() . ' ' . $value;
+ }
+
+ if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else if (isset($this->set_schema)) {
+ $value .= ' ' . $this->p_do_build_set_schema();
+ }
+ else {
+ if (isset($this->as_data_type)) {
+ $value .= ' ' . $this->p_do_build_as_data_type();
+ }
+
+ if (isset($this->increment_by)) {
+ $value .= ' ' . $this->p_do_build_increment_by();
+ }
+
+ if (isset($this->min_value)) {
+ $value .= ' ' . $this->p_do_build_min_value();
+ }
+
+ if (isset($this->max_value)) {
+ $value .= ' ' . $this->p_do_build_max_value();
+ }
+
+ if (isset($this->start_with)) {
+ $value .= ' ' . $this->p_do_build_start_with();
+ }
+
+ if (isset($this->restart_with)) {
+ $value .= ' ' . $this->p_do_build_restart_with();
+ }
+
+ if (isset($this->cache)) {
+ $value .= ' ' . $this->p_do_build_cache();
+ }
+
+ if (isset($this->cycle)) {
+ $value .= ' ' . $this->p_do_build_cycle();
+ }
+
+ if (isset($this->owned_by)) {
+ $value .= ' ' . $this->p_do_build_owned_by();
+ }
+ }
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
+
+ return new c_base_return_true();
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a class for specific Postgesql query: ALTER SERVER.
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_query.php');
+
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_options.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_version.php');
+
+
+/**
+ * The class for building and returning a Postgresql ALTER SERVER query string.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterserver.html
+ */
+class c_database_alter_coalation extends c_database_query {
+ use t_database_name;
+ use t_database_options;
+ use t_database_owner_to;
+ use t_database_rename_to;
+ use t_database_version;
+
+ protected const p_QUERY_COMMAND = 'alter server';
+
+
+ /**
+ * Class constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+
+ $this->name = NULL;
+ $this->options = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
+ $this->version = NULL;
+ }
+
+ /**
+ * Class destructor.
+ */
+ public function __destruct() {
+ unset($this->name);
+ unset($this->options);
+ unset($this->owner_to);
+ unset($this->rename_to);
+ unset($this->version);
+
+ parent::__destruct();
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_new()
+ */
+ public static function s_new($value) {
+ return self::p_s_new($value, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_value()
+ */
+ public static function s_value($return) {
+ return self::p_s_value($return, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value_exact::p_s_value_exact()
+ */
+ public static function s_value_exact($return) {
+ return self::p_s_value_exact($return, __CLASS__, '');
+ }
+
+ /**
+ * Implements do_build().
+ */
+ public function do_build() {
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+
+ if (isset($this->options)) {
+ if (isset($this->version)) {
+ $value .= ' ' . $this->p_do_build_version();
+ }
+ $value .= ' ' . $this->p_do_build_options();
+ }
+ else if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
+
+ return new c_base_return_true();
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a class for specific Postgesql query: ALTER STATISTICS.
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_query.php');
+
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_set_schema.php');
+
+
+/**
+ * The class for building and returning a Postgresql ALTER STATISTICS query string.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-alterstatistics.html
+ */
+class c_database_alter_coalation extends c_database_query {
+ use t_database_name;
+ use t_database_rename_to;
+ use t_database_set_schema;
+
+ protected const p_QUERY_COMMAND = 'alter statistics';
+
+
+ /**
+ * Class constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+
+ $this->name = NULL;
+ $this->rename_to = NULL;
+ $this->set_schema = NULL;
+ }
+
+ /**
+ * Class destructor.
+ */
+ public function __destruct() {
+ unset($this->name);
+ unset($this->rename_to);
+ unset($this->set_schema);
+
+ parent::__destruct();
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_new()
+ */
+ public static function s_new($value) {
+ return self::p_s_new($value, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_value()
+ */
+ public static function s_value($return) {
+ return self::p_s_value($return, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value_exact::p_s_value_exact()
+ */
+ public static function s_value_exact($return) {
+ return self::p_s_value_exact($return, __CLASS__, '');
+ }
+
+ /**
+ * Implements do_build().
+ */
+ public function do_build() {
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+
+ if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else if (isset($this->set_schema)) {
+ $value .= ' ' . $this->p_do_build_set_schema();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
+
+ return new c_base_return_true();
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a class for specific Postgesql query: ALTER COALATION.
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_query.php');
+
+require_once('common/database/traits/database_connection.php');
+require_once('common/database/traits/database_disable.php');
+require_once('common/database/traits/database_enable.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_refresh_publication.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_set.php');
+require_once('common/database/traits/database_set_publication_name.php');
+require_once('common/database/traits/database_set_schema.php');
+require_once('common/database/traits/database_with_publication_option.php');
+require_once('common/database/traits/database_with_refresh_option.php');
+
+
+/**
+ * The class for building and returning a Postgresql ALTER SUBSCRIPTION query string.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-altersubsciption.html
+ */
+class c_database_alter_subscription extends c_database_query {
+ use t_database_connection;
+ use t_database_disable;
+ use t_database_enable;
+ use t_database_name;
+ use t_database_owner_to;
+ use t_database_refresh_publication;
+ use t_database_rename_to;
+ use t_database_set;
+ use t_database_set_publication_name;
+ use t_database_set_schema;
+ use t_database_with_publication_option;
+ use t_database_with_refresh_option;
+
+ protected const p_QUERY_COMMAND = 'alter subsciption';
+
+
+ /**
+ * Class constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+
+ $this->connection = NULL;
+ $this->disable = NULL;
+ $this->enable = NULL;
+ $this->name = NULL;
+ $this->owner_to = NULL;
+ $this->refresh_publication = NULL;
+ $this->rename_to = NULL;
+ $this->set = NULL;
+ $this->set_publication_name = NULL;
+ $this->set_schema = NULL;
+ $this->with_publication_option = NULL;
+ $this->with_refresh_option = NULL;
+ }
+
+ /**
+ * Class destructor.
+ */
+ public function __destruct() {
+ unset($this->connection);
+ unset($this->disable);
+ unset($this->enable);
+ unset($this->name);
+ unset($this->owner_to);
+ unset($this->refresh_publication);
+ unset($this->rename_to);
+ unset($this->set);
+ unset($this->set_publication_name);
+ unset($this->set_schema);
+ unset($this->with_publication_option);
+ unset($this->with_refresh_option);
+
+ parent::__destruct();
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_new()
+ */
+ public static function s_new($value) {
+ return self::p_s_new($value, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_value()
+ */
+ public static function s_value($return) {
+ return self::p_s_value($return, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value_exact::p_s_value_exact()
+ */
+ public static function s_value_exact($return) {
+ return self::p_s_value_exact($return, __CLASS__, '');
+ }
+
+ /**
+ * Implements do_build().
+ */
+ public function do_build() {
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+ if (isset($this->connection)) {
+ $value .= ' ' . $this->p_do_build_connection();
+ }
+ else if (isset($this->set_publication_name)) {
+ $value .= ' ' . $this->p_do_build_set_publication_name();
+
+ if (isset($this->with_publication_option)) {
+ $value .= ' ' . $this->p_do_build_with_publication_option();
+ }
+ }
+ else if (isset($this->refresh_publication)) {
+ $value .= ' ' . $this->p_do_build_refresh_publication();
+
+ if (isset($this->with_refresh_option)) {
+ $value .= ' ' . $this->p_do_build_with_refresh_option();
+ }
+ }
+ else if (isset($this->enable)) {
+ $value .= ' ' . $this->p_do_build_enable();
+ }
+ else if (isset($this->disable)) {
+ $value .= ' ' . $this->p_do_build_disable();
+ }
+ else if (isset($this->set)) {
+ $value .= ' ' . $this->p_do_build_set();
+ }
+ else if (isset($this->owner_to)) {
+ $value .= ' ' . $this->p_do_build_owner_to();
+ }
+ else if (isset($this->rename_to)) {
+ $value .= ' ' . $this->p_do_build_rename_to();
+ }
+ else {
+ unset($value);
+ return new c_base_return_false();
+ }
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
+
+ return new c_base_return_true();
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a class for specific Postgesql query: ALTER COALATION.
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_query.php');
+
+
+/**
+ * The class for building and returning a Postgresql ALTER COALATION query string.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-alteraggregate.html
+ */
+class c_database_alter_coalation extends c_database_query {
+ protected const p_QUERY_COMMAND = 'alter coalation';
+
+
+ /**
+ * Class constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+
+ /**
+ * Class destructor.
+ */
+ public function __destruct() {
+ parent::__destruct();
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_new()
+ */
+ public static function s_new($value) {
+ return self::p_s_new($value, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_value()
+ */
+ public static function s_value($return) {
+ return self::p_s_value($return, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value_exact::p_s_value_exact()
+ */
+ public static function s_value_exact($return) {
+ return self::p_s_value_exact($return, __CLASS__, '');
+ }
+
+ /**
+ * Implements do_build().
+ */
+ public function do_build() {
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
+
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
+
+ return new c_base_return_true();
+ }
+}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
class c_database_string {
public const ACCESS_METHOD = 'access method';
public const ADD = 'add';
+ public const ADD_TABLE = 'add table';
public const AGGREGATE = 'aggregate';
public const ALL = 'all';
public const ALLOW_CONNECTIONS = 'allow_connections';
public const AUTOVACUUM_MULTIXACT_FREEZE_TABLE_AGE = 'autovacuum_multixact_freeze_table_age';
public const AUTOVACUUM_SCALE_FACTOR = 'autovacuum_scale_factor';
public const AUTOVACUUM_VACUUM_THRESHOLD = 'autovacuum_vacuum_threshold';
+ public const BYPASSRLS = 'bypassrls';
public const BUFFERING = 'buffering';
+ public const CACHE = 'cache';
public const CALLED_ON_NULL_INPUT = 'called on null input';
public const CASCADE = 'cascade';
public const CAST = 'cast';
public const CLUSTER_ON = 'cluster on';
public const COLLATION = 'collation';
public const COLUMN = 'column';
+ public const CONNECT = 'connect';
+ public const CONNECTION = 'connection';
public const CONNECTION_LIMIT = 'connection limit';
public const CONVERSION = 'conversion';
+ public const COPY_DATA = 'copy_data';
public const COST = 'cost';
public const CREATE = 'create';
+ public const CREATEDB = 'createdb';
+ public const CREATEROLE = 'createrole';
+ public const CREATE_SLOT = 'create_slot';
+ public const CYCLE = 'cycle';
public const DEFAULT = 'default';
public const DELETE = 'delete';
public const DEPENDS_ON_EXTENSION = 'depends on extension';
public const DESCEND = 'desc';
+ public const DISABLE = 'disable';
public const DISABLE_TRIGGER = 'disable trigger';
public const DOMAIN = 'domain';
public const DROP = 'drop';
+ public const DROP_TABLE = 'drop table';
public const DROP_CONSTRAINT = 'drop constraint';
public const DROP_DEFAULT = 'drop default';
+ public const ENABLE = 'enable';
+ public const ENABLED = 'enabled';
public const ENABLE_ALWAYS_TRIGGER = 'enable always trigger';
public const ENABLE_REPLICA_TRIGGER = 'enable replica trigger';
public const ENABLE_TRIGGER = 'enable trigger';
public const EXTENDED = 'extended';
public const EXTERNAL = 'external';
public const FALSE = 'false';
- public const FAST_UPDATE = 'fastupdate';
- public const FILL_FACTOR = 'fillfactor';
+ public const FASTUPDATE = 'fastupdate';
+ public const FILLFACTOR = 'fillfactor';
public const FOREIGN_DATA_WRAPPER = 'foreign data wrapper';
public const FOREIGN_TABLE = 'foreign table';
public const FOR = 'for';
+ public const FOR_ORDER_BY = 'for order by';
public const FOR_ROLE = 'for role';
+ public const FOR_SEARCH = 'for search';
public const FROM_CURRENT = 'from current';
public const FUNCTION = 'function';
public const GRANT = 'grant';
public const IF_EXISTS = 'if exists';
public const IMMUTABLE = 'immutable';
public const IN = 'in';
+ public const IN_DATABASE = 'in database';
public const INOUT = 'inout';
public const IN_SCHEMA = 'in schema';
public const INHERIT = 'inherit';
public const IS_TEMPLATE = 'is_template';
public const LANGUAGE = 'language';
public const LEAKPROOF = 'leakproof';
+ public const LOGIN = 'login';
public const LOG_AUTOVACUUM_MIN_DURATION = 'log_autovacuum_min_duration';
public const MAIN = 'main';
public const MATERIALIZED_VIEW = 'materialized view';
+ public const MAXVALUE = 'maxvalue';
+ public const MINVALUE = 'minvalue';
public const N_DISTINCT = 'n_distinct';
public const N_DISTINCT_INHERITED = 'n_distinct_inherited';
+ public const NO = 'no';
+ public const NOBYPASSRLS = 'nobypassrls';
+ public const NOCREATEDB = 'nocreatedb';
+ public const NOCREATEROLE = 'nocreaterole';
+ public const NOINHERIT = 'noinherit';
+ public const NOLOGIN = 'nologin';
+ public const NOREPLICATION = 'noreplication';
+ public const NOSUPERUSER = 'nosuperuser';
public const NO_HANDLER = 'no handler';
public const NO_INHERIT = 'no inherit';
public const NO_VALIDATOR = 'no validator';
public const ON_TABLES_TO = 'on tables to';
public const ON_TYPES = 'on types';
public const ONLY = 'only';
+ public const OPERATOR = 'operator';
public const OPERATOR_CLASS = 'operator class';
public const OPERATOR_FAMILY = 'operator family';
public const OPTIONS = 'options';
public const PAGES_PER_RANGE = 'pages_per_range';
public const PARALLEL = 'parallel';
public const PARALLEL_WORKERS = 'parallel_workers';
+ public const PASSWORD = 'password';
+ public const PASSWORD_ENCRYPTED = 'encypted password';
public const PLAIN = 'plain';
public const PROCEDURAL = 'procedural';
public const PUBLIC = 'public';
+ public const PUBLISH = 'publish';
public const REFERENCES = 'references';
+ public const REFRESH = 'refresh';
+ public const REFRESH_PUBLICATION = 'refresh publication';
public const REFRESH_VERSION = 'refresh version';
public const RENAME_TO = 'rename to';
public const RENAME_COLUMN = 'rename column';
public const RENAME_CONSTRAINT = 'rename constraint';
+ public const REPLICATION = 'replication';
public const RESET = 'reset';
public const RESET_ALL = 'reset all';
+ public const RESET_PUBLICATION = 'reset publication';
+ public const RESTART_WITH = 'restart with';
public const RESTRICT = 'restrict';
public const RESTRICTED = 'restricted';
public const RETURNS_NULL_ON_NULL_INPUT = 'returns null on null input';
public const SERVER = 'server';
public const SET = 'set';
public const SET_DEFAULT = 'set default';
+ public const SET_PUBLICATION = 'set publication';
public const SET_SCHEMA = 'set schema';
public const SET_STATISTICS = 'set statistics';
public const SET_STORAGE = 'set storage';
+ public const SET_TABLE = 'set table';
public const SET_TABLESPACE = 'set tablespace';
public const SET_WITH_OIDS = 'set with oids';
public const SET_WITHOUT_CLUSTER = 'set without cluster';
public const SET_WITHOUT_OIDS = 'set without oids';
+ public const SLOT_NAME = 'slot_name';
public const STABLE = 'stable';
+ public const START_WITH = 'start with';
public const STRICT = 'strict';
+ public const SUPERUSER = 'superuser';
+ public const SYNCHRONOUS_COMMIT = 'synchronous_commit';
public const TABLE = 'table';
public const TEXT_SEARCH_CONFIGURATION = 'text search configuration';
public const TEXT_SEARCH_DICTIONARY = 'text search dictionary';
public const USING = 'using';
public const VALIDATOR = 'validator';
public const VALIDATE_CONSTRAINT = 'validate constraint';
+ public const VALIDUNTIL = 'validuntil';
public const VARIADIC = 'variadic';
+ public const VERSION = 'version';
public const VOLATILE = 'volatile';
public const VIEW = 'view';
public const WITH = 'with';
+ public const WITH_CHECK = 'with check';
public const WITH_GRANT_OPTION = 'with grant option';
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
* Implements do_build().
*/
public function do_build() {
- $this->value = NULL;
+ if (is_null($this->name)) {
+ return new c_base_return_false();
+ }
- // @todo
+ $value = $this->p_do_build_name();
+
+ $this->value = static::p_QUERY_COMMAND;
+ $this->value .= ' ' . $value;
+ unset($value);
return new c_base_return_true();
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with operator family add/dop and related queries.
+ */
+class e_database_operator_family {
+ public const NONE = 0;
+ public const FUNCTION = 1;
+ public const OPERATOR = 2;
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with operator add/drop for and related queries.
+ */
+class e_database_operator_for {
+ public const NONE = 0;
+ public const FOR_ORDER_BY = 1;
+ public const FOR_SEARCH = 2;
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with publication option and related queries.
+ */
+class e_database_publication_option {
+ public const NONE = 0;
+ public const REFRESH = 1;
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with index publication parameter and related queries.
+ */
+class e_database_publication_parameter {
+ public const NONE = 0;
+ public const PUBLISH = 1;
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with index publication value and related queries.
+ */
+class e_database_publication_value {
+ public const NONE = 0;
+ public const DELETE = 1;
+ public const INSERT = 2;
+ public const UPDATE = 3;
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with refresh option and related queries.
+ */
+class e_database_refresh_option {
+ public const NONE = 0;
+ public const COPY_DATA = 1;
+}
*/
class e_database_role {
public const NONE = 0;
- public const GROUP = 1;
- public const NAME = 2;
- public const PUBLIC = 3;
+ public const ALL = 1;
+ public const GROUP = 2;
+ public const NAME = 3;
+ public const PUBLIC = 4;
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with postgresql role option information.
+ */
+class e_database_role_option {
+ public const NONE = 0;
+ public const BYPASSRLS = 1;
+ public const CONNECTION_LIMIT = 2;
+ public const CREATEDB = 3;
+ public const CREATEROLE = 4;
+ public const INHERIT = 5;
+ public const LOGIN = 6;
+ public const NOBYPASSRLS = 7;
+ public const NOCREATEDB = 8;
+ public const NOCREATEROLE = 9;
+ public const NOINHERIT = 10;
+ public const NOLOGIN = 11;
+ public const NOREPLICATION = 12;
+ public const NOSUPERUSER = 13;
+ public const PASSWORD = 14;
+ public const PASSWORD_ENCRYPTED = 15;
+ public const REPLICATION = 16;
+ public const SUPERUSER = 17;
+ public const VALIDUNTIL = 18;
+}
namespace n_koopa;
/**
- * Codes associated with index storage_parameter and related queries.
+ * Codes associated with index storage parameter and related queries.
*/
class e_database_storage_parameter {
public const NONE = 0;
public const AUTOVACUUM_SCALE_FACTOR = 12;
public const AUTOVACUUM_VACUUM_THRESHOLD = 13;
public const BUFFERING = 14;
- public const FAST_UPDATE = 15;
- public const FILL_FACTOR = 16;
+ public const FASTUPDATE = 15;
+ public const FILLFACTOR = 16;
public const GIN_PENDING_LIST_LIMIT = 17;
public const LOG_AUTOVACUUM_MIN_DURATION = 18;
public const PAGES_PER_RANGE = 19;
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides enumeration classes for managing codes used for generating specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * Codes associated with subscription parameter and related queries.
+ */
+class e_database_subscription_parameter {
+ public const NONE = 0;
+ public const CONNECT = 1;
+ public const COPY_DATA = 2;
+ public const CREATE_SLOT = 3;
+ public const ENABLED = 4;
+ public const SLOT_NAME = 5;
+ public const SYNCHRONOUS_COMMIT = 6;
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+require_once('common/database/enumerations/database_operator_family.php');
+require_once('common/database/enumerations/database_operator_for.php');
+
+/**
+ * Provide the sql ADD/DROP OPERATOR/FUNCTION functionality.
+ */
+trait t_database_add_operator_family {
+ protected $add_operator_family;
+
+ /**
+ * Set the add user or drop user.
+ *
+ * @param bool|null $add
+ * Set to TRUE for ADD OPERATOR.
+ * Set to FALSE for DROP OPERATOR.
+ * Set to NULL to disable.
+ * When NULL, this will remove all values.
+ * @param int|null $type
+ * The operator type from e_database_operator_family.
+ * This is required when $add is not NULL.
+ * @param int|null $strategy
+ * (optional) The strategy number.
+ * This is required when $add is not NULL.
+ * @param string|null $name
+ * (optional) The operator name.
+ * This is required when $add is TRUE.
+ * @param string|null $left_type
+ * (optional) The (left) operator type.
+ * This is required when $add is not NULL.
+ * @param string|null $ight_type
+ * (optional) The (right) operator type.
+ * This is required when $add is TRUE and $type is OPERATOR.
+ * @param int|null $for_type
+ * (optional) The for type from e_database_operator_for.
+ * This is required when $add is TRUE and $type is OPERATOR.
+ * @param string|null $sort_family_name
+ * (optional) The sort family name.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with error bit set is returned on error.
+ */
+ public function set_add_operator_family($add, $type = NULL, $strategy = NULL, $name = NULL, $left_type = NULL, $right_type = NULL, $for_type = NULL, $sort_family_name = NULL) {
+ if (is_null($add)) {
+ $this->add_operator_family = NULL;
+ return new c_base_return_true();
+ }
+
+ if (!is_bool($add)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'add', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ switch ($type) {
+ case e_database_operator_family::OPERATOR:
+ case e_database_operator_family::FUNCTION:
+ break;
+
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_int($strategy)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'strategy', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!($add && is_string($name)) || !(!$add && is_null($name))) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if ($add && $type === e_database_operator_family::OPERATOR) {
+ switch ($for_type) {
+ case e_database_operator_for::FOR_ORDER_BY:
+ case e_database_operator_for::FOR_SEARCH:
+ break;
+
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'for_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+ }
+
+ if (!is_string($left_type)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'left_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_string($right_type) && !(!$add && $type === e_database_operator_family::OPERATOR && is_null($right_type))) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'right_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($sort_family_name) && !is_string($sort_family_name)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'sort_family_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ $value = [
+ 'type' => $type,
+ 'strategy' => $strategy,
+ 'name' => NULL,
+ 'left_type' => NULL,
+ 'right_type' => NULL,
+ 'for_type' => NULL,
+ 'sort_family_name' => NULL,
+ ];
+
+ if ($add) {
+ $placeholder = $this->add_placeholder($name);
+ if ($placeholder->has_error()) {
+ unset($value);
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $value['name'] = $placeholder;
+ }
+
+ $placeholder = $this->add_placeholder($left_type);
+ if ($placeholder->has_error()) {
+ unset($add_operator_family);
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $value['left_type'] = $placeholder;
+
+ if (is_string($right_type)) {
+ $placeholder = $this->add_placeholder($right_type);
+ if ($placeholder->has_error()) {
+ unset($add_operator_family);
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $value['right_type'] = $placeholder;
+ }
+
+ if ($add) {
+ $placeholder = $this->add_placeholder($for_type);
+ if ($placeholder->has_error()) {
+ unset($value);
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $value['for_type'] = $placeholder;
+
+ if (is_string($sort_family_name)) {
+ $placeholder = $this->add_placeholder($sort_family_name);
+ if ($placeholder->has_error()) {
+ unset($value);
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $value['sort_family_name'] = $placeholder;
+ }
+ }
+ unset($placeholder);
+
+ if (!is_array($this->add_operator_family)) {
+ $this->add_operator_family = [
+ 'add' => TRUE,
+ 'values' => [],
+ ];
+ }
+
+ $this->add_operator_family['add'] = $add;
+ $this->add_operator_family['values'][] = $value;
+ unset($value);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the add/drop user settings.
+ *
+ * @param int|null $index
+ * (optional) Get the argument type array at the specified index.
+ * When NULL, all argument type are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array representing the add/drop operator settings at the $index.
+ * An array representing all add/drop operator settings when $index is NULL.
+ * NULL is returned if not set (add/drop operator is not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_add_operator_family($index = NULL) {
+ if (is_null($this->add_operator_family)) {
+ return new c_base_return_null();
+ }
+
+ if (is_null($index)) {
+ return c_base_return_array::s_new($this->add_operator_family);
+ }
+ else if (isset($this->add_operator_family['values'][$index]) && is_array($this->add_operator_family['values'][$index])) {
+ return c_base_return_array::s_new($this->add_operator_family['values'][$index]);
+ }
+ else {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'argument_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_null($error);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'add_operator_family', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_add_operator_family() {
+ $value = NULL;
+
+ if ($this->add_operator_family['add']) {
+ $value = c_database_string::ADD;
+ }
+ else {
+ $value = c_database_string::DROP;
+ }
+
+ $values = [];
+ foreach ($this->add_operator_family['values'] as $add_operator_family) {
+ if ($add_operator_family['for_type'] === e_database_operator_family::FUNCTION) {
+ $value .= ' ' . c_database_string::FUNCTION;
+ }
+ else if ($add_operator_family['for_type'] === e_database_operator_family::OPERATOR) {
+ $value .= ' ' . c_database_string::OPERATOR;
+ }
+
+ $value .= ' ' . $add_operator_family['strategy'];
+
+ if ($add_operator_family['add']) {
+ $value .= ' ' . $add_operator_family['name'];
+ }
+
+ $value .= ' (' . $add_operator_family['left_type'];
+ if (is_string($add_operator_family['right_type'])) {
+ $value .= ' (' . $add_operator_family['right_type'];
+ }
+ $value .= ')';
+
+ if ($add_operator_family['add'] && $add_operator_family['type'] === e_database_operator_family::OPERATOR) {
+ if ($add_operator_family['for_type'] === e_database_operator_for::FOR_ORDER_BY) {
+ $value .= ' ' . c_database_string::FOR_ORDER_BY;
+ if (isset($add_operator_family['sort_family_name'])) {
+ $value .= ' ' . $add_operator_family['sort_family_name'];
+ }
+ }
+ else if ($add_operator_family['for_type'] === e_database_operator_for::FOR_SEARCH) {
+ $value .= ' ' . c_database_string::FOR_SEARCH;
+ }
+ }
+
+ $values[] = $add_operator_family;
+ }
+ unset($add_operator_family);
+
+ return $value . implode(', ', $values);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql ADD TABLE functionality.
+ */
+trait t_database_add_table {
+ protected $add_table;
+
+ /**
+ * Set the ADD TABLE settings.
+ *
+ * @param string|null $name
+ * The table name.
+ * Set to NULL to disable.
+ * @param bool|null $only
+ * (optional) whether or not to specify ONLY.
+ * @param bool|null $descendents
+ * (optional) whether or not to specify a wildcard after the table name.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_add_table($name, $only = NULL, $descendents = NULL) {
+ if (is_null($name)) {
+ $this->add_table = NULL;
+ return new c_base_return_true();
+ }
+
+ if (!is_string($name)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($only) && !is_bool($only)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($descendents) && !is_bool($descendents)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'descendents', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ $placeholder = $this->add_placeholder($name);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ if (!is_array($this->add_table)) {
+ $this->add_table = [
+ 'only' => NULL,
+ 'values' => [],
+ ];
+ }
+
+ $this->add_table['values'][] = [
+ 'name' => $placeholder,
+ 'descendents' => $descendents,
+ ];
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned add table settings.
+ *
+ * @param int|null $index
+ * (optional) Get the add table settings at the specified index.
+ * When NULL, all add table settings are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the add table settings on success.
+ * NULL is returned if not set (add table not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_add_table() {
+ if (is_null($this->add_table)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->add_table)) {
+ return c_base_return_array::s_new($this->add_table);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'add_table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_add_table() {
+ $value = c_database_string::ADD_TABLE;
+
+ if ($this->add_table['only']) {
+ $value .= ' ' . c_database_string::ONLY;
+ }
+
+ $values = [];
+ foreach ($this->add_table['values'] as $add_value) {
+ $name = $add_value['name'];
+ if ($add_value['descendents']) {
+ $name .= ' *';
+ }
+ $values[] = $name;
+ }
+ unset($add_value);
+ unset($name);
+
+ return $value . ' ' . implode(', ', $values);
+ }
+}
/**
* Set the add user or drop user.
*
- * @param string|int|bool|null $role_type
+ * @param string|int|bool|null $name
* The user name (role name) to use.
* Set to TRUE to toggle to ADD USER (default).
* Set to FALSE to toggle to DROP USER.
return new c_base_return_null();
}
- if (is_null($this->argument_type['type'])) {
+ if (is_null($index)) {
return c_base_return_array::s_new($this->argument_type);
}
else if (isset($this->argument_type[$index]) && is_array($this->argument_type[$index])) {
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql AS data type functionality.
+ */
+trait t_database_as_data_type {
+ protected $as_data_type;
+
+ /**
+ * Set the AS data type settings.
+ *
+ * @param string|null $type
+ * The data type to use.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_as_data_type($type) {
+ if (is_null($type)) {
+ $this->as_data_type = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($type)) {
+ $placeholder = $this->add_placeholder($type);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $this->as_data_type = $placeholder;
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned data type.
+ *
+ * @return i_database_query_placeholder|c_base_return_null
+ * A data type query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_as_data_type() {
+ if (is_null($this->as_data_type)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->as_data_type)) {
+ return clone($this->as_data_type);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'as_data_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_as_data_type() {
+ return c_database_string::AS . ' ' . $this->as_data_type;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql CACHE functionality.
+ */
+trait t_database_cache {
+ protected $cache;
+
+ /**
+ * Set the CACHE settings.
+ *
+ * @param int|null $sequence
+ * The cache sequence number to use.
+ * Postgesql only supports 1 or greater.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_cache($sequence) {
+ if (is_null($sequence)) {
+ $this->cache = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_int($sequence) && $sequence > 0) {
+ $this->cache = $sequence;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'sequence', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned cache sequence number.
+ *
+ * @return c_base_return_int|c_base_return_null
+ * A cache sequence number.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_cache() {
+ if (is_null($this->cache)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->cache)) {
+ return c_base_return_int::s_new($this->cache);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'cache', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_cache() {
+ return c_database_string::CACHE . ' ' . $this->cache;
+ }
+}
require_once('common/base/classes/base_return.php');
/**
- * Provide the sql NAME functionality.
+ * Provide the sql CLUSTER ON functionality.
*/
trait t_database_cluster_on {
protected $cluster_on;
/**
- * Set the OID settings.
+ * Set the CLUSTER ON settings.
*
* @param string|null $index_name
* The index name to use.
}
/**
- * Get the currently assigned index name.
+ * Get the currently assigned cluster on setting.
*
* @return i_database_query_placeholder|c_base_return_null
* A index name query placeholder on success.
* NULL is returned if there is nothing to process or there is an error.
*/
protected function p_do_build_cluster_on() {
- return strval($this->cluster_on);
+ return c_database_string::CLUSTER_ON . ' ' . strval($this->cluster_on);
}
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql CONNECTION functionality.
+ */
+trait t_database_connection {
+ protected $connection;
+
+ /**
+ * Set the CONNECTION settings.
+ *
+ * @param string|null $value
+ * The connection information to use.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_connection($value) {
+ if (is_null($value)) {
+ $this->connection = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($value)) {
+ $placeholder = $this->add_placeholder($value);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $this->connection = $placeholder;
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned on connection information settings.
+ *
+ * @return i_database_query_placeholder|c_base_return_null
+ * A connection information query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_connection() {
+ if (is_null($this->connection)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->connection)) {
+ return clone($this->connection);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'connection', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_connection() {
+ return c_database_string::CONNECTION . ' ' . strval($this->connection);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql CYCLE functionality.
+ */
+trait t_database_cycle {
+ protected $cycle;
+
+ /**
+ * Set the CYCLE settings.
+ *
+ * @param bool|null $cycle
+ * Set to TRUE for CYCLE.
+ * Set to FALSE fo NO CYCLE.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_cycle($cycle) {
+ if (is_null($cycle)) {
+ $this->cycle = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_bool($cycle)) {
+ $this->cycle = $cycle;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'cycle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned data type.
+ *
+ * @return c_base_return_bool|c_base_return_null
+ * A boolean with TRUE repesenting CYCLE and FALSE representing NO CYCLE.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_cycle() {
+ if (is_null($this->cycle)) {
+ return new c_base_return_null();
+ }
+
+ if (is_bool($this->cycle)) {
+ return c_base_return_bool::s_new($this->cycle);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'cycle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_cycle() {
+ if ($this->cycle) {
+ return c_database_string::CYCLE;
+ }
+
+ return c_database_string::NO . ' ' . c_database_string::CYCLE;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql DISABLE functionality.
+ */
+trait t_database_disable {
+ protected $disable;
+
+ /**
+ * Set the DISABLE settings.
+ *
+ * @param bool|null $disable
+ * Set to TRUE for DISABLE.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_disable($disable) {
+ if (is_null($disable)) {
+ $this->disable = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_bool($disable)) {
+ $this->disable = $disable;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'disable', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned data type.
+ *
+ * @return c_base_return_bool|c_base_return_null
+ * A boolean with TRUE repesenting DISABLE.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_disable() {
+ if (is_null($this->disable)) {
+ return new c_base_return_null();
+ }
+
+ if (is_bool($this->disable)) {
+ return c_base_return_bool::s_new($this->disable);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'disable', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_disable() {
+ if ($this->disable) {
+ return c_database_string::DISABLE;
+ }
+
+ return NULL;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql DROP TABLE functionality.
+ */
+trait t_database_drop_value {
+ protected $drop_value;
+
+ /**
+ * Set the DROP TABLE settings.
+ *
+ * @param string|null $name
+ * The table name.
+ * Set to NULL to disable.
+ * @param bool|null $only
+ * (optional) whether or not to specify ONLY.
+ * @param bool|null $descendents
+ * (optional) whether or not to specify a wildcard after the table name.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_drop_value($name, $only = NULL, $descendents = NULL) {
+ if (is_null($name)) {
+ $this->drop_value = NULL;
+ return new c_base_return_true();
+ }
+
+ if (!is_string($name)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($only) && !is_bool($only)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($descendents) && !is_bool($descendents)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'descendents', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ $placeholder = $this->add_placeholder($name);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ if (!is_array($this->drop_value)) {
+ $this->drop_value = [
+ 'only' => NULL,
+ 'values' => [],
+ ];
+ }
+
+ $this->drop_value['values'][] = [
+ 'name' => $placeholder,
+ 'descendents' => $descendents,
+ ];
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned add table settings.
+ *
+ * @param int|null $index
+ * (optional) Get the add table settings at the specified index.
+ * When NULL, all add table settings are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the add table settings on success.
+ * NULL is returned if not set (add table not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_drop_value() {
+ if (is_null($this->drop_value)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->drop_value)) {
+ return c_base_return_array::s_new($this->drop_value);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'drop_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_drop_value() {
+ $value = c_database_string::DROP_TABLE;
+
+ if ($this->drop_value['only']) {
+ $value .= ' ' . c_database_string::ONLY;
+ }
+
+ $values = [];
+ foreach ($this->drop_value['values'] as $drop_value) {
+ $name = $drop_value['name'];
+ if ($drop_value['descendents']) {
+ $name .= ' *';
+ }
+ $values[] = $name;
+ }
+ unset($drop_value);
+ unset($name);
+
+ return $value . ' ' . implode(', ', $values);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql ENABLE functionality.
+ */
+trait t_database_enable {
+ protected $enable;
+
+ /**
+ * Set the ENABLE settings.
+ *
+ * @param bool|null $enable
+ * Set to TRUE for ENABLE.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_enable($enable) {
+ if (is_null($enable)) {
+ $this->enable = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_bool($enable)) {
+ $this->enable = $enable;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'enable', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned data type.
+ *
+ * @return c_base_return_bool|c_base_return_null
+ * A boolean with TRUE repesenting ENABLE.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_enable() {
+ if (is_null($this->enable)) {
+ return new c_base_return_null();
+ }
+
+ if (is_bool($this->enable)) {
+ return c_base_return_bool::s_new($this->enable);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'enable', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_enable() {
+ if ($this->enable) {
+ return c_database_string::ENABLE;
+ }
+
+ return NULL;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql IN DATABASE functionality.
+ */
+trait t_database_in_database {
+ protected $in_database;
+
+ /**
+ * Set the IN DATABASE settings.
+ *
+ * @param string|null $name
+ * The database name to use.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_in_database($name) {
+ if (is_null($name)) {
+ $this->in_database = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($name)) {
+ $placeholder = $this->add_placeholder($name);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $this->in_database = $placeholder;
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned database name.
+ *
+ * @return i_database_query_placeholder|c_base_return_null
+ * A database name query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_in_database() {
+ if (is_null($this->in_database)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->in_database)) {
+ return clone($this->in_database);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'in_database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_in_database() {
+ return c_database_string::IN_DATABASE . ' ' . $this->in_database;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql INCREMENT BY functionality.
+ */
+trait t_database_increment_by {
+ protected $increment_by;
+
+ /**
+ * Set the INCREMENT BY settings.
+ *
+ * @param int|null $by
+ * A positive or negative number to increment by.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_increment_by($by) {
+ if (is_null($by)) {
+ $this->increment_by = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_int($by)) {
+ $this->increment_by = $by;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned increment by value.
+ *
+ * @return c_base_return_int|c_base_return_null
+ * An increment by number.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_increment_by() {
+ if (is_null($this->increment_by)) {
+ return new c_base_return_null();
+ }
+
+ if (is_int($this->increment_by)) {
+ return c_base_return_int::s_new($this->increment_by);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'increment_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_increment_by() {
+ return c_database_string::INCREMENT_BY . ' ' . $this->increment_by;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql MAXVALUE functionality.
+ */
+trait t_database_max_value {
+ protected $max_value;
+
+ /**
+ * Set the MAXVALUE data type settings.
+ *
+ * @param int|false|null $value
+ * A number representing the max value.
+ * Set to FALSE for NO MAXVALUE.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_max_value($value) {
+ if (is_null($value)) {
+ $this->max_value = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_int($value) || $value === FALSE) {
+ $this->max_value = $value;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned max value.
+ *
+ * @return c_base_return_string|c_base_return_bool|c_base_return_null
+ * A number representing the max value.
+ * FALSE for no max value.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_max_value() {
+ if (is_null($this->max_value)) {
+ return new c_base_return_null();
+ }
+
+ if (is_int($this->max_value)) {
+ return c_base_return_int::s_new($this->max_value);
+ }
+ else if ($this->max_value === FALSE) {
+ return c_base_return_bool::s_new($this->max_value);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'max_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_max_value() {
+ if ($this->max_value === FALSE) {
+ return c_database_string::NO . ' ' . c_database_string::MAXVALUE;
+ }
+
+ return c_database_string::MAXVALUE . ' ' . $this->max_value;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql MINVALUE functionality.
+ */
+trait t_database_min_value {
+ protected $min_value;
+
+ /**
+ * Set the MINVALUE data type settings.
+ *
+ * @param int|false|null $value
+ * A number representing the min value.
+ * Set to FALSE for NO MINVALUE.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_min_value($value) {
+ if (is_null($value)) {
+ $this->min_value = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_int($value) || $value === FALSE) {
+ $this->min_value = $value;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned min value.
+ *
+ * @return c_base_return_string|c_base_return_bool|c_base_return_null
+ * A number representing the min value.
+ * FALSE for no min value.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_min_value() {
+ if (is_null($this->min_value)) {
+ return new c_base_return_null();
+ }
+
+ if (is_int($this->min_value)) {
+ return c_base_return_int::s_new($this->min_value);
+ }
+ else if ($this->min_value === FALSE) {
+ return c_base_return_bool::s_new($this->min_value);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'min_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_min_value() {
+ if ($this->min_value === FALSE) {
+ return c_database_string::NO . ' ' . c_database_string::MINVALUE;
+ }
+
+ return c_database_string::MINVALUE . ' ' . $this->min_value;
+ }
+}
require_once('common/base/classes/base_return.php');
/**
- * Provide the sql NAME functionality.
- */
-trait t_database_oid {
- protected $oid;
-
- /**
- * Set the OID settings.
- *
- * @param string|null $oid
- * The oid to use.
- * Set to NULL to disable.
- *
- * @return c_base_return_status
- * TRUE on success, FALSE otherwise.
- * FALSE with the error bit set is returned on error.
- */
- public function set_oid($oid) {
- if (is_null($oid)) {
- $this->oid = NULL;
- return new c_base_return_true();
- }
-
- if (is_string($oid)) {
- $placeholder = $this->add_placeholder($oid);
- if ($placeholder->has_error()) {
- return c_base_return_error::s_false($placeholder->get_error());
- }
-
- $this->oid = $placeholder;
- unset($placeholder);
-
- return new c_base_return_true();
- }
-
- $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
- return c_base_return_error::s_false($error);
- }
-
- /**
- * Get the currently assigned oid.
- *
- * @return i_database_query_placeholder|c_base_return_null
- * A oid query placeholder on success.
- * NULL is returned if not set.
- * NULL with the error bit set is returned on error.
- */
- public function get_oid() {
- if (is_null($this->oid)) {
- return new c_base_return_null();
- }
-
- if (isset($this->oid)) {
- return clone($this->oid);
- }
-
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
- return c_base_return_error::s_null($error);
- }
-
- /**
- * Perform the common build process for this trait.
- *
- * As an internal trait method, the caller is expected to perform any appropriate validation.
- *
- * @return string|null
- * A string is returned on success.
- * NULL is returned if there is nothing to process or there is an error.
- */
- protected function p_do_build_oid() {
- return strval($this->oid);
- }
-}
-
-/**
- * Provide the sql NAME functionality.
+ * Provide the sql OID functionality.
*/
trait t_database_oid {
protected $oid;
require_once('common/base/classes/base_return.php');
/**
- * Provide the sql USING functionality.
+ * Provide the sql ON TABLE functionality.
*/
-trait t_database_using {
- protected $using;
+trait t_database_on_table {
+ protected $on_table;
/**
- * Set the USING settings.
+ * Set the ON TABLE settings.
*
- * @param string|null $using
- * The using to use.
+ * @param string|null $name
+ * The table name to use.
* Set to NULL to disable.
*
* @return c_base_return_status
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_using($using) {
- if (is_null($using)) {
- $this->using = NULL;
+ public function set_on_table($name) {
+ if (is_null($name)) {
+ $this->on_table = NULL;
return new c_base_return_true();
}
- if (is_string($using)) {
- $placeholder = $this->add_placeholder($using);
+ if (is_string($name)) {
+ $placeholder = $this->add_placeholder($name);
if ($placeholder->has_error()) {
return c_base_return_error::s_false($placeholder->get_error());
}
- $this->using = $placeholder;
+ $this->on_table = $placeholder;
unset($placeholder);
return new c_base_return_true();
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'using', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
}
/**
- * Get the currently assigned using.
+ * Get the currently assigned on table settings.
*
* @return i_database_query_placeholder|c_base_return_null
- * A using query placeholder on success.
+ * A name query placeholder on success.
* NULL is returned if not set.
* NULL with the error bit set is returned on error.
*/
- public function get_using() {
- if (is_null($this->using)) {
+ public function get_on_table() {
+ if (is_null($this->on_table)) {
return new c_base_return_null();
}
- if (isset($this->using)) {
- return clone($this->using);
+ if (isset($this->on_table)) {
+ return clone($this->on_table);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'using', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'on_table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
* A string is returned on success.
* NULL is returned if there is nothing to process or there is an error.
*/
- protected function p_do_build_using() {
- return strval($this->using);
+ protected function p_do_build_on_table() {
+ return strval($this->on_table);
}
}
}
if (is_int($owned_by)) {
- if ($owned_by === e_database_user::ALL) {
+ if ($owned_by === e_database_user::ALL || $owned_by === e_database_user::NONE) {
$this->owned_by = e_database_user::ALL;
return new c_base_return_true();
}
if (is_null($index)) {
- if ($this->owned_by === e_database_user::ALL) {
+ if ($this->owned_by === e_database_user::ALL || $this->owned_by === e_database_user::NONE) {
return c_base_return_array::s_new([$this->owned_by]);
}
else if (is_array($this->owned_by)) {
* NULL is returned if there is nothing to process or there is an error.
*/
protected function p_do_build_owned_by() {
- $owned_by = c_database_string::OWNED_BY . ' ';
+ $value = c_database_string::OWNED_BY . ' ';
if ($this->owned_by === e_database_user::ALL) {
- $owned_by .= c_database_string::ALL;
+ $value .= c_database_string::ALL;
+ }
+ else if ($this->owned_by === e_database_user::NONE) {
+ $value .= c_database_string::NONE;
}
else {
- $owned_by .= implode(', ', $this->owned_by);
+ $value .= implode(', ', $this->owned_by);
}
- return $owned_by;
+ return $value;
}
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql REFRESH PUBLICATION functionality.
+ */
+trait t_database_refresh_publication {
+ protected $refresh_publication;
+
+ /**
+ * Set the REFRESH PUBLICATION settings.
+ *
+ * @param bool|null $refresh
+ * Set to TRUE to use REFRESH PUBLICATION.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_refresh_publication($refresh) {
+ if (is_null($option)) {
+ $this->refresh_publication = NULL;
+ return new c_base_return_true();
+ }
+
+ if (!is_bool($refresh)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => '$refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ $this->refresh_publication = $refresh;
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned REFRESH PUBLICATION setting.
+ *
+ * @return c_base_return_bool|c_base_return_null
+ * A boolean representing whether or not refresh publication is to be used.
+ * NULL is returned if not set (refresh publication not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_refresh_publication($index = NULL) {
+ if (is_null($this->refresh_publication)) {
+ return new c_base_return_null();
+ }
+
+ return c_base_return_bool::s_new($this->refresh_publication);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_refresh_publication() {
+ if ($this->refresh_publication) {
+ return c_database_string::REFRESH_PUBLICATION;
+ }
+
+ return NULL;
+ }
+}
switch ($storage_parameter) {
case e_database_storage_parameter::AUTOSUMMARIZE:
case e_database_storage_parameter::BUFFERING:
- case e_database_storage_parameter::FAST_UPDATE:
- case e_database_storage_parameter::FILL_FACTOR:
+ case e_database_storage_parameter::FASTUPDATE:
+ case e_database_storage_parameter::FILLFACTOR:
case e_database_storage_parameter::GIN_PENDING_LIST_LIMIT:
case e_database_storage_parameter::PAGES_PER_RANGE:
break;
else if ($storage_parameter === e_database_storage_parameter::BUFFERING) {
$values[] = c_database_string::BUFFERING;
}
- else if ($storage_parameter === e_database_storage_parameter::FAST_UPDATE) {
- $values[] = c_database_string::FAST_UPDATE;
+ else if ($storage_parameter === e_database_storage_parameter::FASTUPDATE) {
+ $values[] = c_database_string::FASTUPDATE;
}
- else if ($storage_parameter === e_database_storage_parameter::FILL_FACTOR) {
- $values[] = c_database_string::FILL_FACTOR;
+ else if ($storage_parameter === e_database_storage_parameter::FILLFACTOR) {
+ $values[] = c_database_string::FILLFACTOR;
}
else if ($storage_parameter === e_database_storage_parameter::GIN_PENDING_LIST_LIMIT) {
$values[] = c_database_string::GIN_PENDING_LIST_LIMIT;
}
unset($storage_parameter);
- return c_database_string::RESET . ' ' . implode(', ', $values);
+ return c_database_string::RESET . ' (' . implode(', ', $values) . ')';
}
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql RESTART WITH functionality.
+ */
+trait t_database_restart_with {
+ protected $restart_with;
+
+ /**
+ * Set the RESTART WITH settings.
+ *
+ * @param int|null $value
+ * A number representing the start with value.
+ * Set to FALSE to use the default start with value.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_restart_with($value) {
+ if (is_null($value)) {
+ $this->restart_with = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_int($value) || $value === FALSE) {
+ $this->restart_with = $value;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned restart with value.
+ *
+ * @return c_base_return_int|c_base_return_bool|c_base_return_null
+ * A number representing the start with value.
+ * FALSE is returned when default START WITH value is to be used.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_restart_with() {
+ if (is_null($this->restart_with)) {
+ return new c_base_return_null();
+ }
+
+ if (is_int($this->restart_with)) {
+ return c_base_return_int::s_new($this->restart_with);
+ }
+ else if (is_bool($this->restart_with)) {
+ return c_base_return_bool::s_new($this->restart_with);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'restart_with', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_restart_with() {
+ return c_database_string::RESTART_WITH . ' ' . $this->restart_with;
+ }
+}
*
* @param int|string|null $name
* A string representing the role name to use.
- * May be an integer of either e_database_role::CURRENT or e_database_role::SESSION.
+ * May be an integer of from e_database_role.
* Set to NULL to disable.
* When NULL, this will remove all values.
*
$this->role_specification = $placeholder;
unset($placeholder);
}
- else if ($name !== e_database_role::CURRENT && $name !== e_database_role::SESSION) {
+ else if ($name !== e_database_role::ALL && $name !== e_database_role::CURRENT && $name !== e_database_role::SESSION) {
$error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
* Get the role specification.
*
* @return c_base_return_int|i_database_query_placeholder|c_base_return_null
- * A role name query placeholder or an integer representing either e_database_role::CURRENT or e_database_role::SESSION on success.
+ * A role name query placeholder or an integer from e_database_role.
* NULL is returned if not set.
* NULL with the error bit set is returned on error.
*/
return new c_base_return_null();
}
- if ($this->role_specification === e_database_role::CURRENT || $this->role_specification === e_database_role::SESSION) {
+ if ($this->role_specification === e_database_role::ALL || $this->role_specification === e_database_role::CURRENT || $this->role_specification === e_database_role::SESSION) {
return c_base_return_int::s_new($this->role_specification);
}
else if (isset($this->role_specification)) {
protected function p_do_build_role_specification() {
$value = NULL;
if (is_string($this->role_specification)) {
- $value = $this->role_specification;
+ $value = strval($this->role_specification);
+ }
+ else if ($this->role_specification === e_database_role::ALL) {
+ $value = c_database_string::ALL;
}
else if ($this->role_specification === e_database_role::CURRENT) {
$value = c_database_string::CURRENT;
$value = c_database_string::SESSION;
}
- return strval($value);
+ return $value;
}
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql SET PUBLICATION name functionality.
+ */
+trait t_database_set_publication_name {
+ protected $set_publication_name;
+
+ /**
+ * Set the SET PUBLICATION (name ...) settings.
+ *
+ * @param string|null $name
+ * The publication name.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_set_publication_name($name) {
+ if (is_null($option)) {
+ $this->set_publication_name = NULL;
+ return new c_base_return_true();
+ }
+
+ if (!is_string($name)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_array($this->set_publication_name)) {
+ $this->set_publication_name = [];
+ }
+
+ $this->set_publication_name[] = $name;
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned SET PUBLICATION name at the specified index.
+ *
+ * @param int|null $index
+ * (optional) Get the publication name at the specified index.
+ * When NULL, all publication names are returned.
+ *
+ * @return c_base_return_array|c_base_return_string|c_base_return_null
+ * An array of publication names or a string representing the publication name at $index..
+ * NULL is returned if not set (publication name not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_set_publication_name($index = NULL) {
+ if (is_null($this->set_publication_name)) {
+ return new c_base_return_null();
+ }
+
+ if (is_null($index)) {
+ if (is_array($this->set_publication_name)) {
+ return c_base_return_array::s_new($this->set_publication_name);
+ }
+ }
+ else {
+ if (is_int($index) && array_key_exists($index, $this->set_publication_name)) {
+ return c_base_return_string::s_new($this->set_publication_name[$index]);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_publication_name[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_publication_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_set_publication_name() {
+ return c_database_string::SET_PUBLICATION . ' ' . implode(', ', $this->set_publication_name);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/enumerations/database_publication_parameter.php');
+require_once('common/database/enumerations/database_publication_value.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql SET publication parameter functionality.
+ */
+trait t_database_set_publication_parameter {
+ protected $set_publication_parameter;
+
+ /**
+ * Set the SET (publication_parameter ...) settings.
+ *
+ * @param int|null $parameter
+ * The publication parameter code to assign.
+ * Should be one of: e_database_publication_parameter.
+ * Set to NULL to disable.
+ * @param int|null $value
+ * The type code to assign the parameter from e_database_publication_value.
+ * This must not be NULL when $parameter is not NULL.
+ * When NULL, this is ignored.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_set_publication_parameter($parameter, $value = NULL) {
+ if (is_null($parameter)) {
+ $this->set_publication_parameter = NULL;
+ return new c_base_return_true();
+ }
+
+ switch ($parameter) {
+ case e_database_publication_parameter::PUBLISH:
+ break;
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ switch ($value) {
+ case e_database_publication_value::DELETE:
+ case e_database_publication_value::INSERT:
+ case e_database_publication_value::UPDATE:
+ break;
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_array($this->set_publication_parameter)) {
+ $this->set_publication_parameter = [];
+ }
+
+ $this->set_publication_parameter[] = [
+ 'type' => $parameter,
+ 'value' => $value,
+ ];
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned SET publication parameter at the specified index.
+ *
+ * @param int|null $index
+ * (optional) Get the publication parameter type at the specified index.
+ * When NULL, all publication parameter types are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the set publication parameter settings on success.
+ * NULL is returned if not set (publication parameter not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_set_publication_parameter($index = NULL) {
+ if (is_null($this->set_publication_parameter)) {
+ return new c_base_return_null();
+ }
+
+ if (is_null($index)) {
+ if (is_array($this->set_publication_parameter)) {
+ return c_base_return_array::s_new($this->set_publication_parameter);
+ }
+ }
+ else {
+ if (is_int($index) && array_key_exists($index, $this->set_publication_parameter)) {
+ return c_base_return_array::s_new($this->set_publication_parameter[$index]);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_publication_parameter[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_publication_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_set_publication_parameter() {
+ $values = [];
+ foreach ($this->set_publication_parameter as $parameter => $value) {
+ if ($parameter === e_database_publication_parameter::PUBLISH) {
+ $parameter_value = c_database_string::PUBLISH . ' = ';
+
+ if ($value === e_database_publication_value::DELETE) {
+ $parameter_value .= c_database_string::DELETE;
+ }
+ else if ($value === e_database_publication_value::INSERT) {
+ $parameter_value .= c_database_string::INSERT;
+ }
+ else if ($value === e_database_publication_value::UPDATE) {
+ $parameter_value .= c_database_string::UPDATE;
+ }
+ else {
+ continue;
+ }
+
+ $values[] = $parameter_value;
+ }
+ }
+ unset($parameter_value);
+ unset($parameter);
+ unset($value);
+
+ return c_database_string::SET . ' (' . implode(', ', $values) . ')';
+ }
+}
* Set the RENAME TO settings.
*
* @param string|null $set_schema
- * The name to rename to.
+ * The schema name.
* Set to NULL to disable.
*
* @return c_base_return_status
* Get the currently assigned schema name to set to.
*
* @return i_database_query_placeholder|c_base_return_null
- * A schema name on success.
+ * A schema name query placeholder on success.
* NULL is returned if not set (set schema is not to be used).
* NULL with the error bit set is returned on error.
*/
require_once('common/database/classes/database_string.php');
/**
- * Provide the sql SET functionality.
+ * Provide the sql SET storage parameter functionality.
*/
trait t_database_set_storage_parameter {
protected $set_storage_parameter;
/**
* Set the SET index (storage_parameter ...) settings.
*
- * @param int|null $storage_parameter
+ * @param int|null $parameter
* The storage parameter code to assign.
* Should be one of: e_database_storage_parameter.
* Set to NULL to disable.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_storage_parameter($storage_parameter, $value = NULL) {
- if (is_null($storage_parameter)) {
+ public function set_set_storage_parameter($parameter, $value = NULL) {
+ if (is_null($parameter)) {
$this->set_storage_parameter = NULL;
return new c_base_return_true();
}
- switch ($storage_parameter) {
+ switch ($parameter) {
case e_database_storage_parameter::AUTOSUMMARIZE:
case e_database_storage_parameter::BUFFERING:
- case e_database_storage_parameter::FAST_UPDATE:
- case e_database_storage_parameter::FILL_FACTOR:
+ case e_database_storage_parameter::FASTUPDATE:
+ case e_database_storage_parameter::FILLFACTOR:
case e_database_storage_parameter::GIN_PENDING_LIST_LIMIT:
case e_database_storage_parameter::PAGES_PER_RANGE:
break;
default:
- $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'storage_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
}
}
$this->set_storage_parameter[] = [
- 'type' => $storage_parameter,
+ 'type' => $parameter,
'value' => $placeholder,
];
unset($placeholder);
*/
protected function p_do_build_set_storage_parameter() {
$values = [];
- foreach ($this->set_storage_parameter as $storage_parameter => $value) {
- if ($storage_parameter === e_database_storage_parameter::AUTOSUMMARIZE) {
+ foreach ($this->set_storage_parameter as $parameter => $value) {
+ if ($parameter === e_database_storage_parameter::AUTOSUMMARIZE) {
$values[] = c_database_string::AUTOSUMMARIZE . ' = ' . $value;
}
- else if ($storage_parameter === e_database_storage_parameter::BUFFERING) {
+ else if ($parameter === e_database_storage_parameter::BUFFERING) {
$values[] = c_database_string::BUFFERING . ' = ' . $value;
}
- else if ($storage_parameter === e_database_storage_parameter::FAST_UPDATE) {
- $values[] = c_database_string::FAST_UPDATE . ' = ' . $value;
+ else if ($parameter === e_database_storage_parameter::FASTUPDATE) {
+ $values[] = c_database_string::FASTUPDATE . ' = ' . $value;
}
- else if ($storage_parameter === e_database_storage_parameter::FILL_FACTOR) {
- $values[] = c_database_string::FILL_FACTOR . ' = ' . $value;
+ else if ($parameter === e_database_storage_parameter::FILLFACTOR) {
+ $values[] = c_database_string::FILLFACTOR . ' = ' . $value;
}
- else if ($storage_parameter === e_database_storage_parameter::GIN_PENDING_LIST_LIMIT) {
+ else if ($parameter === e_database_storage_parameter::GIN_PENDING_LIST_LIMIT) {
$values[] = c_database_string::GIN_PENDING_LIST_LIMIT . ' = ' . $value;
}
- else if ($storage_parameter === e_database_storage_parameter::PAGES_PER_RANGE) {
+ else if ($parameter === e_database_storage_parameter::PAGES_PER_RANGE) {
$values[] = c_database_string::PAGES_PER_RANGE . ' = ' . $value ;
}
}
- unset($storage_parameter);
+ unset($parameter);
unset($value);
- return c_database_string::SET . ' ' . implode(', ', $values);
+ return c_database_string::SET . ' (' . implode(', ', $values) . ')';
}
}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql SET TABLE functionality.
+ */
+trait t_database_set_table {
+ protected $set_table;
+
+ /**
+ * Set the SET TABLE settings.
+ *
+ * @param string|null $name
+ * The table name.
+ * Set to NULL to disable.
+ * @param bool|null $only
+ * (optional) whether or not to specify ONLY.
+ * @param bool|null $descendents
+ * (optional) whether or not to specify a wildcard after the table name.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_set_table($name, $only = NULL, $descendents = NULL) {
+ if (is_null($name)) {
+ $this->set_table = NULL;
+ return new c_base_return_true();
+ }
+
+ if (!is_string($name)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($only) && !is_bool($only)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_null($descendents) && !is_bool($descendents)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'descendents', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ $placeholder = $this->add_placeholder($name);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ if (!is_array($this->set_table)) {
+ $this->set_table = [
+ 'only' => NULL,
+ 'values' => [],
+ ];
+ }
+
+ $this->set_table['values'][] = [
+ 'name' => $placeholder,
+ 'descendents' => $descendents,
+ ];
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned add table settings.
+ *
+ * @param int|null $index
+ * (optional) Get the add table settings at the specified index.
+ * When NULL, all add table settings are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the add table settings on success.
+ * NULL is returned if not set (add table not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_set_table() {
+ if (is_null($this->set_table)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->set_table)) {
+ return c_base_return_array::s_new($this->set_table);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_set_table() {
+ $value = c_database_string::SET_TABLE;
+
+ if ($this->set_table['only']) {
+ $value .= ' ' . c_database_string::ONLY;
+ }
+
+ $values = [];
+ foreach ($this->set_table['values'] as $set_value) {
+ $name = $set_value['name'];
+ if ($set_value['descendents']) {
+ $name .= ' *';
+ }
+ $values[] = $name;
+ }
+ unset($set_value);
+ unset($name);
+
+ return $value . ' ' . implode(', ', $values);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql START WITH functionality.
+ */
+trait t_database_start_with {
+ protected $start_with;
+
+ /**
+ * Set the START WITH settings.
+ *
+ * @param int|null $value
+ * A number representing the start with value.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_start_with($value) {
+ if (is_null($value)) {
+ $this->start_with = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_int($value)) {
+ $this->start_with = $value;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned start with value.
+ *
+ * @return c_base_return_string|c_base_return_null
+ * A number representing the start with value.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_start_with() {
+ if (is_null($this->start_with)) {
+ return new c_base_return_null();
+ }
+
+ if (is_int($this->start_with)) {
+ return c_base_return_int::s_new($this->start_with);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'start_with', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_start_with() {
+ return c_database_string::START_WITH . ' ' . $this->start_with;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql USING expression functionality.
+ */
+trait t_database_using_expression {
+ protected $using_expression;
+
+ /**
+ * Set the USING expression settings.
+ *
+ * @param string|null $sql_expression
+ * An SQL conditional expression.
+ * This is not converted to a placeholder because it is an SQL expression.
+ * The caller must ensure SQL safety.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_using_expression($sql_expression) {
+ if (is_null($sql_expression)) {
+ $this->using_expression = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($sql_expression)) {
+ $this->using_expression = $sql_expression;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'sql_expression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned USING expression settings.
+ *
+ * @return c_base_return_string|c_base_return_null
+ * A name query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_using_expression() {
+ if (is_null($this->using_expression)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->using_expression)) {
+ return c_base_return_string::s_new($this->using_expression);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'using_expression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_using_expression() {
+ return c_database_string::USING . ' ' . $this->using_expression;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql USING functionality.
+ */
+trait t_database_using_index_method {
+ protected $using_index_method;
+
+ /**
+ * Set the USING settings.
+ *
+ * @param string|null $using_index_method
+ * The using_index_method to use.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_using_index_method($using_index_method) {
+ if (is_null($using_index_method)) {
+ $this->using_index_method = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($using_index_method)) {
+ $placeholder = $this->add_placeholder($using_index_method);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $this->using_index_method = $placeholder;
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'using_index_method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned using_index_method.
+ *
+ * @return i_database_query_placeholder|c_base_return_null
+ * A using_index_method query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_using_index_method() {
+ if (is_null($this->using_index_method)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->using_index_method)) {
+ return clone($this->using_index_method);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'using_index_method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_using_index_method() {
+ return strval($this->using_index_method);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql VERSION functionality.
+ */
+trait t_database_version {
+ protected $version;
+
+ /**
+ * Set the VERSION settings.
+ *
+ * @param string|null $version
+ * The version to use.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_version($version) {
+ if (is_null($version)) {
+ $this->version = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($version)) {
+ $placeholder = $this->add_placeholder($version);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $this->version = $placeholder;
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned on version settings.
+ *
+ * @return i_database_query_placeholder|c_base_return_null
+ * A version query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_version() {
+ if (is_null($this->version)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->version)) {
+ return clone($this->version);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_version() {
+ return strval($this->version);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+/**
+ * Provide the sql WITH CHECK expression functionality.
+ */
+trait t_database_with_check_expression {
+ protected $with_check_expression;
+
+ /**
+ * Set the WITH CHECK expression settings.
+ *
+ * @param string|null $sql_expression
+ * An SQL conditional expression.
+ * This is not converted to a placeholder because it is an SQL expression.
+ * The caller must ensure SQL safety.
+ * Set to NULL to disable.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_with_check_expression($sql_expression) {
+ if (is_null($sql_expression)) {
+ $this->with_check_expression = NULL;
+ return new c_base_return_true();
+ }
+
+ if (is_string($sql_expression)) {
+ $this->with_check_expression = $sql_expression;
+ return new c_base_return_true();
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'sql_expression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ /**
+ * Get the currently assigned WITH CHECK expression settings.
+ *
+ * @return c_base_return_string|c_base_return_null
+ * A name query placeholder on success.
+ * NULL is returned if not set.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_with_check_expression() {
+ if (is_null($this->with_check_expression)) {
+ return new c_base_return_null();
+ }
+
+ if (isset($this->with_check_expression)) {
+ return c_base_return_string::s_new($this->with_check_expression);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_check_expression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_with_check_expression() {
+ return c_database_string::WITH_CHECK . ' ' . $this->with_check_expression;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/enumerations/database_publication_option.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql WITH publication option functionality.
+ */
+trait t_database_with_publication_option {
+ protected $with_publication_option;
+
+ /**
+ * Set the WITH (publication_option ...) settings.
+ *
+ * @param int|null $option
+ * The publication option code to assign.
+ * Should be one of: e_database_publication_option.
+ * Set to NULL to disable.
+ * @param bool|null $value
+ * Set the option value to either TRUE or FALSE.
+ * This is ignored when $option is NULL.
+ * When NULL, this is ignored.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_with_publication_option($option, $value = NULL) {
+ if (is_null($option)) {
+ $this->with_publication_option = NULL;
+ return new c_base_return_true();
+ }
+
+ switch ($option) {
+ case e_database_publication_option::REFRESH:
+ break;
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_bool($value)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_array($this->with_publication_option)) {
+ $this->with_publication_option = [];
+ }
+
+ $this->with_publication_option[] = [
+ 'option' => $option,
+ 'value' => $value,
+ ];
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned WITH publication option at the specified index.
+ *
+ * @param int|null $index
+ * (optional) Get the publication options at the specified index.
+ * When NULL, all publication options are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the with publication option settings on success.
+ * NULL is returned if not set (with publication option not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_with_publication_option($index = NULL) {
+ if (is_null($this->with_publication_option)) {
+ return new c_base_return_null();
+ }
+
+ if (is_null($index)) {
+ if (is_array($this->with_publication_option)) {
+ return c_base_return_array::s_new($this->with_publication_option);
+ }
+ }
+ else {
+ if (is_int($index) && array_key_exists($index, $this->with_publication_option)) {
+ return c_base_return_array::s_new($this->with_publication_option[$index]);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_publication_option[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_publication_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_with_publication_option() {
+ $values = [];
+ foreach ($this->with_publication_option as $option) {
+ if ($parameter === e_database_publication_option::REFRESH) {
+ $value = c_database_string::REFRESH . ' = ';
+
+ if ($option) {
+ $value .= c_database_string::TRUE;
+ }
+ else {
+ $value .= c_database_string::FALSE;
+ }
+
+ $values[] = $value;
+ }
+ }
+ unset($option);
+ unset($value);
+
+ return c_database_string::WITH . ' (' . implode(', ', $values) . ')';
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/enumerations/database_refresh_option.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql WITH refresh option functionality.
+ */
+trait t_database_with_refresh_option {
+ protected $with_refresh_option;
+
+ /**
+ * Set the WITH (refresh_option ...) settings.
+ *
+ * @param int|null $option
+ * The refresh option code to assign.
+ * Should be one of: e_database_refresh_option.
+ * Set to NULL to disable.
+ * @param bool|null $value
+ * Set the option value to either TRUE or FALSE.
+ * This is ignored when $option is NULL.
+ * When NULL, this is ignored.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_with_refresh_option($option, $value = NULL) {
+ if (is_null($option)) {
+ $this->with_refresh_option = NULL;
+ return new c_base_return_true();
+ }
+
+ switch ($option) {
+ case e_database_refresh_option::REFRESH:
+ break;
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_bool($value)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_array($this->with_refresh_option)) {
+ $this->with_refresh_option = [];
+ }
+
+ $this->with_refresh_option[] = [
+ 'option' => $option,
+ 'value' => $value,
+ ];
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned WITH refresh option at the specified index.
+ *
+ * @param int|null $index
+ * (optional) Get the refresh options at the specified index.
+ * When NULL, all refresh options are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the with refresh option settings on success.
+ * NULL is returned if not set (with refresh option not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_with_refresh_option($index = NULL) {
+ if (is_null($this->with_refresh_option)) {
+ return new c_base_return_null();
+ }
+
+ if (is_null($index)) {
+ if (is_array($this->with_refresh_option)) {
+ return c_base_return_array::s_new($this->with_refresh_option);
+ }
+ }
+ else {
+ if (is_int($index) && array_key_exists($index, $this->with_refresh_option)) {
+ return c_base_return_array::s_new($this->with_refresh_option[$index]);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_refresh_option[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_refresh_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_with_refresh_option() {
+ $values = [];
+ foreach ($this->with_refresh_option as $option) {
+ if ($parameter === e_database_refresh_option::COPY_DATA) {
+ $value = c_database_string::COPY_DATA . ' = ';
+
+ if ($option) {
+ $value .= c_database_string::TRUE;
+ }
+ else {
+ $value .= c_database_string::FALSE;
+ }
+
+ $values[] = $value;
+ }
+ }
+ unset($option);
+ unset($value);
+
+ return c_database_string::WITH . ' (' . implode(', ', $values) . ')';
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/classes/database_string.php');
+
+require_once('common/database/enumerations/database_role_option.php');
+
+/**
+ * Provide the sql WITH (role) option functionality.
+ */
+trait t_database_with_role_option {
+ protected $with_role_option;
+
+ /**
+ * Set the with role option.
+ *
+ * @param int|null $type
+ * The option type from e_database_role_option.
+ * Set to NULL to disable.
+ * When NULL, this will remove all values.
+ * @param string|null $value
+ * (optional) A value string associated with the option type.
+ * Required by some option types, ignored by others.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with error bit set is returned on error.
+ */
+ public function set_with_role_option($type, $value = NULL) {
+ if (is_null($type)) {
+ $this->with_role_option = NULL;
+ return new c_base_return_true();
+ }
+
+ $role_option = [
+ 'type' => $type,
+ 'value' => NULL,
+ ];
+
+ switch ($type) {
+ case e_database_role_option::BYPASSRLS:
+ case e_database_role_option::CREATEDB:
+ case e_database_role_option::CREATEROLE:
+ case e_database_role_option::INHERIT:
+ case e_database_role_option::LOGIN:
+ case e_database_role_option::NOBYPASSRLS:
+ case e_database_role_option::NOCREATEDB:
+ case e_database_role_option::NOCREATEROLE:
+ case e_database_role_option::NOINHERIT:
+ case e_database_role_option::NOLOGIN:
+ case e_database_role_option::NOREPLICATION:
+ case e_database_role_option::NOSUPERUSER:
+ case e_database_role_option::REPLICATION:
+ case e_database_role_option::SUPERUSER:
+ break;
+
+ case e_database_role_option::CONNECTION_LIMIT:
+ if (is_int($value)) {
+ $role_option['value'] = $value;
+ }
+ else if (!is_null($value)) {
+ unset($role_option);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+ break;
+
+ case e_database_role_option::PASSWORD:
+ case e_database_role_option::PASSWORD_ENCRYPTED:
+ case e_database_role_option::VALIDUNTIL:
+ if (is_string($value)) {
+ $placeholder = $this->add_placeholder($value);
+ if ($placeholder->has_error()) {
+ unset($role_option);
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $role_option['value'] = $placeholder;
+ unset($placeholder);
+ }
+ else if (!is_null($value)) {
+ unset($role_option);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+ break;
+
+ default:
+ unset($role_option);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_array($this->with_role_option)) {
+ $this->with_role_option = [];
+ }
+
+ $this->with_role_option[] = $role_option;
+ unset($role_option);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the with role option settings.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array of with role option settings on success.
+ * NULL is returned if not set (with role option is not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_with_role_option() {
+ if (is_null($this->with_role_option)) {
+ return new c_base_return_null();
+ }
+
+ if (is_array($this->with_role_option)) {
+ return c_base_return_array::s_new($this->with_role_option);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_role_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_with_role_option() {
+ $values = [];
+ foreach ($this->with_role_option as $role_option) {
+ if ($role_option['type'] === e_database_role_option::BYPASSRLS) {
+ $values[] = c_database_string::BYPASSRLS;
+ }
+ else if ($role_option['type'] === e_database_role_option::CREATEDB) {
+ $values[] = c_database_string::CREATEDB;
+ }
+ else if ($role_option['type'] === e_database_role_option::CREATEROLE) {
+ $values[] = c_database_string::CREATEROLE;
+ }
+ else if ($role_option['type'] === e_database_role_option::INHERIT) {
+ $values[] = c_database_string::INHERIT;
+ }
+ else if ($role_option['type'] === e_database_role_option::LOGIN) {
+ $values[] = c_database_string::LOGIN;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOBYPASSRLS) {
+ $values[] = c_database_string::NOBYPASSRLS;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOCREATEDB) {
+ $values[] = c_database_string::NOCREATEDB;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOCREATEROLE) {
+ $values[] = c_database_string::NOCREATEROLE;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOINHERIT) {
+ $values[] = c_database_string::NOINHERIT;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOLOGIN) {
+ $values[] = c_database_string::NOLOGIN;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOREPLICATION) {
+ $values[] = c_database_string::NOREPLICATION;
+ }
+ else if ($role_option['type'] === e_database_role_option::NOSUPERUSER) {
+ $values[] = c_database_string::NOSUPERUSER;
+ }
+ else if ($role_option['type'] === e_database_role_option::REPLICATION) {
+ $values[] = c_database_string::REPLICATION;
+ }
+ else if ($role_option['type'] === e_database_role_option::SUPERUSER) {
+ $values[] = c_database_string::SUPERUSER;
+ }
+ else if ($role_option['type'] === e_database_role_option::CONNECTION_LIMIT) {
+ $values[] = c_database_string::CONNECTION_LIMIT . ' ' . $role_option['value'];
+ }
+ else if ($role_option['type'] === e_database_role_option::PASSWORD) {
+ $values[] = c_database_string::PASSWORD . ' ' . $role_option['value'];
+ }
+ else if ($role_option['type'] === e_database_role_option::PASSWORD_ENCRYPTED) {
+ $values[] = c_database_string::PASSWORD_ENCRYPTED . ' ' . $role_option['value'];
+ }
+ else if ($role_option['type'] === e_database_role_option::VALIDUNTIL) {
+ $values[] = c_database_string::VALIDUNTIL . ' ' . $role_option['value'];
+ }
+ }
+ unset($role_option);
+
+ $value = c_database_string::WITH;
+ $value .= ' ' . implode(', ', $values);
+ unset($values);
+
+ return $value;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides traits for specific Postgesql Queries.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+
+require_once('common/database/enumerations/database_index_storage_parameter.php');
+
+require_once('common/database/classes/database_string.php');
+
+/**
+ * Provide the sql WITH storage parameter functionality.
+ */
+trait t_database_with_storage_parameter {
+ protected $with_storage_parameter;
+
+ /**
+ * Set the WITH index (storage_parameter ...) settings.
+ *
+ * @param int|null $parameter
+ * The storage parameter code to assign.
+ * Should be one of: e_database_storage_parameter.
+ * Set to NULL to disable.
+ * @param string|null $value
+ * The value associated with the parameter.
+ * This must not be NULL when $storage_parameter is not NULL.
+ * When NULL, this is ignored.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with the error bit set is returned on error.
+ */
+ public function set_with_storage_parameter($parameter, $value = NULL) {
+ if (is_null($parameter)) {
+ $this->with_storage_parameter = NULL;
+ return new c_base_return_true();
+ }
+
+ switch ($parameter) {
+ case e_database_storage_parameter::AUTOSUMMARIZE:
+ case e_database_storage_parameter::BUFFERING:
+ case e_database_storage_parameter::FASTUPDATE:
+ case e_database_storage_parameter::FILLFACTOR:
+ case e_database_storage_parameter::GIN_PENDING_LIST_LIMIT:
+ case e_database_storage_parameter::PAGES_PER_RANGE:
+ break;
+ default:
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_string($value)) {
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ return c_base_return_error::s_false($error);
+ }
+
+ if (!is_array($this->with_storage_parameter)) {
+ $this->with_storage_parameter = [];
+ }
+
+ $placeholder = $this->add_placeholder($value);
+ if ($placeholder->has_error()) {
+ return c_base_return_error::s_false($placeholder->get_error());
+ }
+
+ $this->with_storage_parameter[] = [
+ 'type' => $parameter,
+ 'value' => $placeholder,
+ ];
+ unset($placeholder);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the currently assigned WITH index storage parameter at the specified index.
+ *
+ * @param int|null $index
+ * (optional) Get the index storage parameter type at the specified index.
+ * When NULL, all index storage parameter types are returned.
+ *
+ * @return c_base_return_array|c_base_return_null
+ * An array containing the set index storage parameter settings on success.
+ * NULL is returned if not set (set index storage parameter not to be used).
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_with_storage_parameter($index = NULL) {
+ if (is_null($this->with_storage_parameter)) {
+ return new c_base_return_null();
+ }
+
+ if (is_null($index)) {
+ if (is_array($this->with_storage_parameter)) {
+ return c_base_return_array::s_new($this->with_storage_parameter);
+ }
+ }
+ else {
+ if (is_int($index) && array_key_exists($index, $this->with_storage_parameter)) {
+ return c_base_return_array::s_new($this->with_storage_parameter[$index]);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_storage_parameter[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'with_storage_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ return c_base_return_error::s_null($error);
+ }
+
+ /**
+ * Perform the common build process for this trait.
+ *
+ * As an internal trait method, the caller is expected to perform any appropriate validation.
+ *
+ * @return string|null
+ * A string is returned on success.
+ * NULL is returned if there is nothing to process or there is an error.
+ */
+ protected function p_do_build_with_storage_parameter() {
+ $values = [];
+ foreach ($this->with_storage_parameter as $parameter => $value) {
+ if ($parameter === e_database_storage_parameter::AUTOSUMMARIZE) {
+ $values[] = c_database_string::AUTOSUMMARIZE . ' = ' . $value;
+ }
+ else if ($parameter === e_database_storage_parameter::BUFFERING) {
+ $values[] = c_database_string::BUFFERING . ' = ' . $value;
+ }
+ else if ($parameter === e_database_storage_parameter::FASTUPDATE) {
+ $values[] = c_database_string::FASTUPDATE . ' = ' . $value;
+ }
+ else if ($parameter === e_database_storage_parameter::FILLFACTOR) {
+ $values[] = c_database_string::FILLFACTOR . ' = ' . $value;
+ }
+ else if ($parameter === e_database_storage_parameter::GIN_PENDING_LIST_LIMIT) {
+ $values[] = c_database_string::GIN_PENDING_LIST_LIMIT . ' = ' . $value;
+ }
+ else if ($parameter === e_database_storage_parameter::PAGES_PER_RANGE) {
+ $values[] = c_database_string::PAGES_PER_RANGE . ' = ' . $value ;
+ }
+ }
+ unset($parameter);
+ unset($value);
+
+ return c_database_string::WITH . ' (' . implode(', ', $values) . ')';
+ }
+}