:type table: string
        :type value: dict
        :type where: dict
        :type join: dict
        :type commit: bool
512638
def update(self, table, value, where, join=None, commit=True):
        

        value_q, _value_args = self._value_parser(value, columnname=True)

        where_q, _where_args = self._where_parser(where)

        _sql = ''.join(['UPDATE ', self._tablename_parser(table)['formatted_tablename'],
                        self._join_parser(join),
                        ' SET ', value_q, where_q, ';'])
        _args = _value_args + _where_args

        if self.debug:
            return self.cur.mogrify(_sql, _args)

        result = self.cur.execute(_sql, _args)
        if commit:
            self.commit()
        return result
449837
def delete(self, table, where=None, commit=True):
        
        where_q, _args = self._where_parser(where)

        alias = self._tablename_parser(table)['alias']

        _sql = ''.join(['DELETE ',
                        alias + ' ' if alias else '',
                        'FROM ', self._tablename_parser(table)['formatted_tablename'], where_q, ';'])

        if self.debug:
            return self.cur.mogrify(_sql, _args)

        result = self.cur.execute(_sql, _args)
        if commit:
            self.commit()
        return result
308361
function update (table, columns, values) {
    if (this.typecheck) t.typecheck('update', [table, columns, values]);
    if ('string'===typeof columns) {
        columns = [columns];
        values = [values];
    }
    var result = [];
    for (var i=0; i < columns.length; i++) {
        var value = ('string'===typeof values[i]
            // X\'blob\' \'\\xblob\'
            && values[i].indexOf("X\'") != 0 && values[i].indexOf("\'\\x") != 0)
            ? this.string(values[i]) : values[i];
        result.push(columns[i]+'='+value);
    }
    return ['update',table,'set',result.join()].join(' ');
}
1223532
def p_joinx(self,t):
    # todo: support join types http://www.postgresql.org/docs/9.4/static/queries-table-expressions.html#QUERIES-JOIN
    
    if len(t)==4: t[0] = JoinX(t[1],t[3],None,t[2])
    elif len(t)==6: t[0] = JoinX(t[1],t[3],t[5],t[2])
    else: raise NotImplementedError('todo: join .. using')
1108259
def from_(self, table, alias=None):
        
        if isinstance(table, str):
            table = [[table, alias]]
        self.raw_tables = table
        return self
221379
def join_strings(key, value, fmt, meta):  # pylint: disable=unused-argument
    """"""
    if key in ['Para', 'Plain']:
        _join_strings(value)
    elif key == 'Image':
        _join_strings(value[-2])
    elif key == 'Table':
        _join_strings(value[-5])
1338088
def insert(self, table, records, create_cols=False, dtypes=None):
        
        if self._check_db() is False:
            return
        try:
            table = self.db[table]
        except Exception as e:
            self.err(e, "Can not find table " + table)
        t = type(records)
        if t == dict:
            func = table.insert
        elif t == list:
            func = table.insert_many
        else:
            msg = "Rows datatype " + \
                str(t) + " not valid: use a list or a dictionary"
            self.err(msg)
        if create_cols is True:
            try:
                func(records, ensure=True, types=dtypes)
            except Exception as e:
                self.err(e, "Can not insert create columns and insert data")
            return
        else:
            try:
                func(records, types=dtypes)
            except Exception as e:
                self.err(e, "Can not insert data")
            return
        self.ok("Rows inserted in the database")
1174385
def _checkTable(cls, field):
        
        # Get table part
        try:
            (table, field) = field.split('.')
        except ValueError:
            table = cls._sqlTable
        # clean away white space
        table = table.strip()
        field = field.strip()
        # register table
        cls._tables[table] = None
        # and return in proper shape
        return table + '.' + field
397895
def ensure_table_strings(table):
    
    for row in range(len(table)):
        for column in range(len(table[row])):
            table[row][column] = str(table[row][column])
    return table
421793
def make_dict(cls, table):
        
        ret_dict = {}
        for row in table:
            file_handle = cls.create_from_row(row)
        ret_dict[file_handle.key] = file_handle
        return ret_dict
566950
def put(self, key, value, overwrite=True):
        
        self._get_table()
        s = self.to_string(value)
        log.debug("Storing in key '%s' the object: '%s'" % (key, s))
        self.table.put_item(
            data={
                'key': key,
                'value': s,
            },
            overwrite=overwrite
        )
576885
def eval_where(where_list,composite_row,nix,tables_dict):
  ""
  # todo: do I need to use 3vl instead of all() to merge where_list?
  evaluator = Evaluator(composite_row,nix,tables_dict)
  return all(evaluator.eval(w) for w in where_list)
438130
def update(self, **kwargs):
        
        if self.condition is not None:
            self.result = self.do_(self.model.table.update().where(self.condition).values(**kwargs))
        else:
            self.result = self.do_(self.model.table.update().values(**kwargs))
        return self.result
1031596
def declare_string(self, value):
        # type: (Union[Text, str]) -> Tuple[ProvEntity,Text]
        """"""
        byte_s = BytesIO(str(value).encode(ENCODING))
        data_file = self.research_object.add_data_file(byte_s, content_type=TEXT_PLAIN)
        checksum = posixpath.basename(data_file)
        # FIXME: Don't naively assume add_data_file uses hash in filename!
        data_id = "data:%s" % posixpath.split(data_file)[1]
        entity = self.document.entity(
            data_id, {provM.PROV_TYPE: WFPROV["Artifact"],
                      provM.PROV_VALUE: str(value)})  # type: ProvEntity
        return entity, checksum
142484
def reflect_table_data(table, mapping=None, engine_name='default'):
    
    table = reflect_table(table, engine_name)
    mapping = mapping or {}

    from uliweb.utils.sorteddict import SortedDict

    field_type_map = {'VARCHAR':'str', 'VARCHAR2':'str', 'INTEGER':'int', 'FLOAT':'float'}

    meta = {}
    columns = SortedDict()
    #write columns
    _primary_key = None
    for k, v in table.columns.items():
        column_type = v.type
        type_name = column_type.__class__.__name__.lower()
        kwargs = SortedDict()
        field_type = type_name.upper()

        if type_name in ('char', 'varchar'):
            kwargs['max_length'] = column_type.length
        elif type_name in ('text', 'blob', 'integer', 'float', 'bigint'):
            pass
        elif type_name == 'long':
            field_type = 'bigint'
        elif type_name in ('clob',):
            field_type = 'TEXT'
        elif type_name in ('decimal', 'float'):
            kwargs['precision'] = v.type.precision
            kwargs['scale'] = v.type.scale
        elif type_name == 'raw': #oracle
            field_type = 'binary'
            kwargs['max_length'] = column_type.length
        elif type_name == 'number':
            if v.type.scale:
                kwargs['precision'] = v.type.precision
                kwargs['scale'] = v.type.scale
                field_type = 'DECIMAL'
            else:
                field_type = 'int'
        elif type_name == 'numeric':
            field_type = 'DECIMAL'
            kwargs['precision'] = v.type.precision
            kwargs['scale'] = v.type.scale
        elif type_name in ('timestamp',):
            field_type = 'TIMESTAMP'
        elif type_name in ('datetime', 'date', 'time'):
            pass
        #for tinyint will be treated as bool
        elif type_name in ('tinyint', 'boolean'):
            field_type = 'bool'
        else:
            raise ValueError("Don't support column [{0}] for type [{1}] when parsing {2}".format(k, type_name, table.name))

        if v.primary_key:
            kwargs['primary_key'] = True
            _primary_key = k
            if v.autoincrement:
                kwargs['autoincrement'] = True
        if not v.nullable:
            kwargs['nullable'] = False
        if v.server_default:
            server_default = v.server_default.arg
            kwargs['server_default'] = server_default
        if v.index:
            kwargs['index'] = True
        if v.unique:
            kwargs['unique'] = True
        if sa_version >= '1.2' and v.comment:
            kwargs['verbose_name'] = v.comment

        #convert field_type to common python data type
        field_type = field_type_map.get(field_type, field_type)
        columns[k] = field_type, kwargs

    meta['columns'] = columns

    indexes = []
    indexes_names = []
    for index in table.indexes:
        cols = list(index.columns)
        _len = len(cols)
        #if only one column it'll be set to Property
        if _len == 1:
            column_name = cols[0].name
            d = {'index':True}
            if index.unique:
                d['unique'] = index.unique
            columns[column_name][1].update(d)
        else:
            if not index.name in indexes_names:
                indexes.append({'name':index.name, 'columns':[x.name for x in index.columns],
                            'unique':index.unique})
                indexes_names.append(index.name)

    meta['indexes'] = indexes
    return meta
835192
private void tableJoins(String pColumn, boolean pWhereJoin) {
        String join = null;
        String table = null;
	    
        if (pColumn == null) {
            // Identity
            join = getIdentityJoin();
            table = getTable(getProperty(getPrimaryKey()));
        }
        else {
            // Normal
            int dotIndex = -1;
            if ((dotIndex = pColumn.lastIndexOf(".")) <= 0) {
                // No table qualifier
                return;
            }
	    
            // Get table qualifier.
            table = pColumn.substring(0, dotIndex);
	    
            // Don't care about the tables that are not supposed to be selected from
            String property = (String) getProperty(pColumn);
	    
            if (property != null) {
                String mapType = (String) mMapTypes.get(property);
                if (!pWhereJoin && mapType != null && !mapType.equals(DIRECTMAP)) {
                    return;
                }

                join = (String) mJoins.get(property);    
            }	
        }

        // If table is not in the tables Hash, add it, and check for joins.
        if (mTables.get(table) == null) {
            if (join != null) {
                mTables.put(table, join);
		
                StringTokenizer tok = new StringTokenizer(join, "= ");
                String next = null;
		
                while(tok.hasMoreElements()) {
                    next = tok.nextToken();
                    // Don't care about SQL keywords
                    if (next.equals("AND") || next.equals("OR") 
                        || next.equals("NOT") || next.equals("IN")) {
                        continue;
                    }
                    // Check for new tables and joins in this join clause.
                    tableJoins(next, false);
                }
            }
            else {
                // No joins for this table.
                join = "";
                mTables.put(table, join);
            }
        }    
    }
743547
def value_for_key(membersuite_object_data, key):
    
    key_value_dicts = {
        d['Key']: d['Value'] for d
        in membersuite_object_data["Fields"]["KeyValueOfstringanyType"]}
    return key_value_dicts[key]