Parameters:
     - db_name
     - tbl_name
     - part_vals
19244
def append_partition(self, db_name, tbl_name, part_vals):
    
    self.send_append_partition(db_name, tbl_name, part_vals)
    return self.recv_append_partition()
759696
def append_partition_by_name_with_environment_context(self, db_name, tbl_name, part_name, environment_context):
    
    self.send_append_partition_by_name_with_environment_context(db_name, tbl_name, part_name, environment_context)
    return self.recv_append_partition_by_name_with_environment_context()
707430
def get_index_names(self, db_name, tbl_name, max_indexes):
    
    self.send_get_index_names(db_name, tbl_name, max_indexes)
    return self.recv_get_index_names()
1266331
def alter_partitions(self, db_name, tbl_name, new_parts):
    
    self.send_alter_partitions(db_name, tbl_name, new_parts)
    self.recv_alter_partitions()
843212
def _handle_dbproc_call(self, parts, parameters_metadata):
        """"""
        for part in parts:
            if part.kind == part_kinds.ROWSAFFECTED:
                self.rowcount = part.values[0]
            elif part.kind == part_kinds.TRANSACTIONFLAGS:
                pass
            elif part.kind == part_kinds.STATEMENTCONTEXT:
                pass
            elif part.kind == part_kinds.OUTPUTPARAMETERS:
                self._buffer = part.unpack_rows(parameters_metadata, self.connection)
                self._received_last_resultset_part = True
                self._executed = True
            elif part.kind == part_kinds.RESULTSETMETADATA:
                self.description, self._column_types = self._handle_result_metadata(part)
            elif part.kind == part_kinds.RESULTSETID:
                self._resultset_id = part.value
            elif part.kind == part_kinds.RESULTSET:
                self._buffer = part.unpack_rows(self._column_types, self.connection)
                self._received_last_resultset_part = part.attribute & 1
                self._executed = True
            else:
                raise InterfaceError("Stored procedure call, unexpected part kind %d." % part.kind)
        self._executed = True
1109384
private void mergeAllFieldValues(DBObject srcDBObj, DBObject tgtDBObj) {
        for (String fieldName : srcDBObj.getUpdatedFieldNames()) {
            FieldDefinition fieldDef = m_tableDef.getFieldDef(fieldName);
            if (fieldDef != null && (fieldDef.isCollection() || fieldDef.isLinkField())) {
                Set<String> newValueSet =
                    ScalarFieldUpdater.mergeMVFieldValues(tgtDBObj.getFieldValues(fieldName),
                                                          srcDBObj.getRemoveValues(fieldName),
                                                          srcDBObj.getFieldValues(fieldName));
                tgtDBObj.clearValues(fieldName);
                tgtDBObj.addFieldValues(fieldName, newValueSet);
            } else {
                tgtDBObj.clearValues(fieldName);
                tgtDBObj.addFieldValue(fieldName, srcDBObj.getFieldValue(fieldName));
            }
        }
    }
1120745
def _parse_db_lib(cls, library):
        
        database_name = library.split('.', 2)
        if len(database_name) == 2:
            library = database_name[1]
            if database_name[0].startswith(cls.DB_PREFIX):
                database_name = database_name[0]
            else:
                database_name = cls.DB_PREFIX + '_' + database_name[0]
        else:
            database_name = cls.DB_PREFIX
        return database_name, library
212349
def values(self, *args: str, **kwargs: str) -> "ValuesQuery":
        
        fields_for_select = {}  # type: Dict[str, str]
        for field in args:
            if field in fields_for_select:
                raise FieldError("Duplicate key {}".format(field))
            fields_for_select[field] = field

        for return_as, field in kwargs.items():
            if return_as in fields_for_select:
                raise FieldError("Duplicate key {}".format(return_as))
            fields_for_select[return_as] = field

        return ValuesQuery(
            db=self._db,
            model=self.model,
            q_objects=self._q_objects,
            fields_for_select=fields_for_select,
            distinct=self._distinct,
            limit=self._limit,
            offset=self._offset,
            orderings=self._orderings,
            annotations=self._annotations,
            custom_filters=self._custom_filters,
        )
83601
def namedb_query_execute( cur, query, values, abort=True):
    
    return db_query_execute(cur, query, values, abort=abort)
365369
def get_last(self, n=1):
        
        rows = []
        # Get values from the partial db first
        if self.tracker.dbcon_part and check_table_exists(self.tracker.dbcon_part, self.name):
            rows.extend(get_last_row(self.tracker.dbcon_part, self.name, n))
        # Then add rows from the master if required
        if len(rows) < n and check_table_exists(self.tracker.dbcon_master, self.name):
            rows.extend(get_last_row(self.tracker.dbcon_master, self.name, n))
        return rows[-n:]
256766
def db_value(self, value):
        """"""
        if isinstance(value, string_types):
            value = arrow.get(value)

        if isinstance(value, arrow.Arrow):
            value = value.datetime

        return super(ArrowDateTimeField, self).db_value(value)
518936
@Override
	public HsqlDatabaseDescriptor dbByName(final String dbName) {
		Collection<HsqlDatabaseDescriptor> select = CollectionUtils.select(dbs,
				new Predicate<HsqlDatabaseDescriptor>() {

					@Override
					public boolean evaluate(HsqlDatabaseDescriptor db) {
						return dbName.equals(db.getDbName());
					}

				});
		if (CollectionUtils.size(select) == 0) {
			throw new IllegalArgumentException(
					"There are no databases called '" + dbName + "'");
		}
		if (CollectionUtils.size(select) >= 2) {
			throw new IllegalArgumentException(
					"More than one database is called '" + dbName + "'");
		}
		return CollectionUtils.extractSingleton(select);
	}
274671
def name_parts(self):
        """"""

        default = PartialMixin.ANY

        return ([(k, default, True)
                for k, _, _ in PartitionName._name_parts]
                +
                [(k, default, True)
                 for k, _, _ in Name._generated_names]
                )
602182
def dbRestore(self, db_value, context=None):
        
        if db_value is not None:
            return yaml.load(projex.text.nativestring(db_value))
        else:
            return db_value
1228377
def dump_part(part, total_segments=None):
    
    try:
        connection = Connection(host=config['host'], region=config['region'])

        filename = ".".join([config['table_name'], str(part), "dump"])
        if config['compress']:
            opener = gzip.GzipFile
            filename += ".gz"
        else:
            opener = open

        dumper = BatchDumper(connection, config['table_name'], config['capacity'], part, total_segments)

        with opener(filename, 'w') as output:
            while dumper.has_items:
                items = dumper.get_items()

                for item in items:
                    output.write(json.dumps(item))
                    output.write("\n")
                output.flush()
                config['queue'].put(len(items))
        config['queue'].put('complete')
    except Exception as e:
        print('Unhandled exception: {0}'.format(e))
984247
def db_value(self, value):
        
        # Everything is encoded being before being surfaced
        value = flask.json.dumps(value)

        return super(JSONField, self).db_value(value)
503458
public static function _getValues ($params = array (), &$db = FALSE)
	{
		
		// Set select

		if (!isset ($params['select']))
		{
			$params['select']	= '*';
		}
		
		// Set from

		if (!isset ($params['from']))
		{
			$params['from']		= '`' . static::$dbTable . '`';
		}
		
		// Get database slave for read

		if ($db === FALSE)
		{
			$db	=& self::_getDbSlave ();
		}
		
		// Return value

		return $db->getValues ($params);

	}