Executes SQL; returns just the output fieldnames.
497255
def fetch_fieldnames(self, sql: str, *args) -> List[str]:
        """"""
        self.ensure_db_open()
        cursor = self.db.cursor()
        self.db_exec_with_cursor(cursor, sql, *args)
        try:
            return [i[0] for i in cursor.description]
        except:  # nopep8
            log.exception("fetch_fieldnames: SQL was: " + sql)
            raise
565818
private void fetchColumns() {

        Vector temp     = new Vector(20);
        Vector tempType = new Vector(20);

        try {
            if (cConn == null) {
                return;
            }

            if (dbmeta == null) {
                dbmeta = cConn.getMetaData();
            }

            ResultSet colList = dbmeta.getColumns(null, null, tableName, "%");

            while (colList.next()) {
                temp.addElement(colList.getString("COLUMN_NAME"));
                tempType.addElement(new Short(colList.getShort("DATA_TYPE")));
            }

            colList.close();
        } catch (SQLException e) {
            ZaurusEditor.printStatus("SQL Exception: " + e.getMessage());
        }

        columns = new String[temp.size()];

        temp.copyInto(columns);

        columnTypes = new short[temp.size()];

        for (int i = 0; i < columnTypes.length; i++) {
            columnTypes[i] = ((Short) tempType.elementAt(i)).shortValue();
        }
    }
880169
public function list_fields()
	{
		$field_names = array();
		mysql_field_seek($this->result_id, 0);
		while ($field = mysql_fetch_field($this->result_id))
		{
			$field_names[] = $field->name;
		}

		return $field_names;
	}
1332577
def sql(self, dialect=None, inserts=False, creates=True,
            drops=True, metadata_source=None):
        
        result = [self.ddl(dialect, creates=creates, drops=drops)]
        if inserts:
            for row in self.inserts(dialect):
                result.append(row)
        return '\n'.join(result)
416144
def getFields(cls) :
		""""""
		s = set(cls.columns.keys())
		s.remove('json')
		s.remove('raba_id')
		return s
374542
def _make_sql_params(self,kw):
        """"""
        vals = []
        for k,v in kw.iteritems():
            vals.append('%s=%s' %(k,self._conv(v)))
        return vals
464606
public static List<String> getFieldNames(DatabaseMetaData meta, String table) throws SQLException {
        List<String> fieldNameList = new ArrayList<String>();
        TableLocation location = TableLocation.parse(table);
        ResultSet rs = meta.getColumns(location.getCatalog(null), location.getSchema(null), location.getTable(), null);
        try {
            while(rs.next()) {
                fieldNameList.add(rs.getString("COLUMN_NAME"));
            }
        } finally {
            rs.close();
        }
        return fieldNameList;
    }
365451
function outputQuery(compiled, isParameter) {
    var sql = compiled.sql || '';
    if (sql) {
      if (compiled.method === 'select' && (isParameter || compiled.as)) {
        sql = '(' + sql + ')';
        if (compiled.as) {
          return this.alias(sql, this.wrap(compiled.as));
        }
      }
    }
    return sql;
  }
582800
def columns(self):
        """"""
        result = self.query.result()
        return [field.name for field in result.schema]
1088643
def get_sql(self):
        
        sql = ''
        if self.limit and self.limit > 0:
            sql += 'LIMIT {0} '.format(self.limit)
        if self.offset and self.offset > 0:
            sql += 'OFFSET {0} '.format(self.offset)
        return sql
246313
def getAllIDs(cls, where=None, orderBy=None):
        
        (sql, fields) = cls._prepareSQL("SELECTALL", where,
                                        cls._sqlPrimary, orderBy=orderBy)
        curs = cls.cursor()
        curs.execute(sql)
        # We might start eating memory at this point
        rows = curs.fetchall()
        curs.close()
        result = []
        idPositions = [fields.index(key) for key in cls._sqlPrimary]
        for row in rows:
            ids = [row[pos] for pos in idPositions]
            if len(idPositions) > 1:
                ids = tuple(ids)
            else:
                ids = ids[0]
            result.append((ids))
        return result
459583
def as_sql(self, qn, connection=None):
        
        if self.bit:
            return ("(%s.%s | %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask),
                    [])
        return ("(%s.%s & %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask),
                [])
121930
private function dumpSql()
    {
        $this->app['schema']->check();

        $context = [
            'alters'  => $this->app['schema.comparator']->getAlters(),
            'creates' => $this->app['schema.comparator']->getCreates(),
        ];

        foreach ($context as $section) {
            foreach ($section as $sql) {
                $this->io->writeln($sql);
            }
        }
    }
305624
protected Object[] getFieldObjects(Object data) throws SQLException {
		Object[] objects = new Object[argFieldTypes.length];
		for (int i = 0; i < argFieldTypes.length; i++) {
			FieldType fieldType = argFieldTypes[i];
			if (fieldType.isAllowGeneratedIdInsert()) {
				objects[i] = fieldType.getFieldValueIfNotDefault(data);
			} else {
				objects[i] = fieldType.extractJavaFieldToSqlArgValue(data);
			}
			if (objects[i] == null) {
				// NOTE: the default value could be null as well
				objects[i] = fieldType.getDefaultValue();
			}
		}
		return objects;
	}
209271
public int[] executeBatch(String... sqls) throws SQLException {
		Connection conn = null;
		try {
			conn = this.getConnection();
			return SqlExecutor.executeBatch(conn, sqls);
		} catch (SQLException e) {
			throw e;
		} finally {
			this.closeConnection(conn);
		}
	}
954516
def _get_sql(filename):
    """"""
    with open(os.path.join(SQL_DIR, filename), 'r') as f:
        return f.read()
64281
def execute_sql(self, query):
        
        c = self.con.cursor()
        c.execute(query)
        result = c.fetchall()
        return result