check if table was created
969493
public static function check() {
		if (R::count("role") < 1) {
			$role                                = R::dispense("role");
			$role->name                          = "guest";
			$per                                 = new permission("guest");
			$role->role->sharedPermissionList [] = $per->get();
			R::store($role);
		}
	}
1052121
def has_table(table_name):
    """"""
    return db.engine.dialect.has_table(
        db.engine.connect(),
        table_name
    )
1332652
async def create_table(**data):
    

    table = data.get('table')

    try:
        clickhouse_queries.create_table(table, data)
        return 'Table was successfully created'

    except ServerException as e:
        exception_code = int(str(e)[5:8].strip())

        if exception_code == 57:
            return 'Table already exists'
        elif exception_code == 50:
            return 'Invalid params'
49723
def HasTable(self, table_name):
    
    if not self._connection:
      raise RuntimeError(
          'Cannot determine if table exists database not opened.')

    sql_query = self._HAS_TABLE_QUERY.format(table_name)

    self._cursor.execute(sql_query)
    if self._cursor.fetchone():
      return True

    return False
339163
public boolean tableExists(TableReference tableRef) throws IOException {
    try {
      Table fetchedTable = service.tables().get(
          tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()).execute();
      logger.atFine().log(
          "Successfully fetched table '%s' for tableRef '%s'", fetchedTable, tableRef);
      return true;
    } catch (IOException ioe) {
      if (errorExtractor.itemNotFound(ioe)) {
        return false;
      } else {
        // Unhandled exceptions should just propagate up.
        throw ioe;
      }
    }
  }
454700
def created_on(self):
    """"""
    timestamp = self._info.get('creationTime')
    return _parser.Parser.parse_timestamp(timestamp)
550996
function checkTable(count) {
      // Make sure we don't go into an infinite loop
      if (++count > 1000) return cb(new Error('Wait limit exceeded'))

      self.describeTable(function(err, data) {
        if (err) return cb(err)
        if (data.TableStatus !== 'ACTIVE' || (data.GlobalSecondaryIndexes &&
            !data.GlobalSecondaryIndexes.every(function (idx) {return idx.IndexStatus === 'ACTIVE'}))) {
          return setTimeout(checkTable, 1000, count)
        }

        // If the table is ACTIVE then return
        cb(null, data)
      })
    }
357366
def column_exists(self, tablename: str, column: str) -> bool:
        """"""
        sql = """
            SELECT COUNT(*)
            FROM information_schema.columns
            WHERE table_name=?
            AND column_name=?
            AND table_schema={}
        """.format(self.get_current_schema_expr())
        row = self.fetchone(sql, tablename, column)
        return True if row[0] >= 1 else False
836473
function checkForReservedTableName(args) {
  if (!args) {
    return;
  }
  if (args.databaseTypeName) {
    checkTableName(args.name, args.databaseTypeName, args.shouldThrow);
  } else {
    for (let i = 0, types = Object.keys(DatabaseTypes); i < types.length; i++) {
      if (typeof DatabaseTypes[types[i]] !== 'function') {
        checkTableName(args.name, DatabaseTypes[types[i]], args.shouldThrow);
      }
    }
  }
}
871671
def createTable(self, tableName, strFields) :
		''
		if not self.tableExits(tableName) :
			sql = 'CREATE TABLE %s ( %s)' % (tableName, strFields)
			self.execute(sql)
			self.tables.add(tableName)
			return True
		return False
1944
public function hasTable($table)
    {
        $parts = explode('.', $table);
        if (count($parts) == 1) {
            $db = $this->db->getDbname();
            $table = $parts[0];
        } else {
            list($db, $table) = $parts;
        }

        $tableExistsSql = $this->checkTableSqls[$this->db->getDriver()];

        return (bool) $this->db->fetchColumn($tableExistsSql, array($db, $table));
    }
951123
public function tableExists()
    {
        $dbh    = $this->db();
        $table  = $this->table();
        $driver = $dbh->getAttribute(PDO::ATTR_DRIVER_NAME);
        if ($driver === self::SQLITE_DRIVER_NAME) {
            $query = sprintf('SELECT name FROM sqlite_master WHERE type = "table" AND name = "%s";', $table);
        } else {
            $query = sprintf('SHOW TABLES LIKE "%s"', $table);
        }

        $this->logger->debug($query);
        $sth    = $dbh->query($query);
        $exists = $sth->fetchColumn(0);

        return !!$exists;
    }
755081
public function table_exists() {
		return (bool) $this->db->get_row( $this->db->prepare('SHOW TABLES LIKE %s', $this->table ) );
	}
661085
private function _tableExists() {

        // Try a select statement against the table
        // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.
        try {
            $result = mysqli_query($this->link,"SELECT 1 FROM $this->table_name LIMIT 1");
        } catch (\Exception $e) {
            // We got an exception == table not found
            return FALSE;
        }

        // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)
        return $result !== FALSE;
    }
1301925
protected static function _tableExists()
    {
        $db = ConnectionManager::get('default');
        $tables = $db->schemaCollection()->listTables();

        if (in_array('settings_configurations', $tables)) {
            return true;
        }
        return false;
    }
122512
public function sessdb_table_exists() {
		try {
			$this->db->run_query("SELECT * FROM ". self::tableName .
					" ORDER BY ". self::tablePKey ." LIMIT 1");
			$exists = true;
		}
		catch(exception $e) {
			$this->exception_handler(__METHOD__ .": exception while trying to detect table::: ". $e->getMessage());
			$exists = false;
		}
		
		return($exists);
	}
564673
def index_exists(self, table: str, indexname: str) -> bool:
        """"""
        # MySQL:
        sql = ("SELECT COUNT(*) FROM information_schema.statistics"
               " WHERE table_name=? AND index_name=?")
        row = self.fetchone(sql, table, indexname)
        return True if row[0] >= 1 else False