delete schema in DB
189724
void delete() {
        StringBuilder sql = new StringBuilder();
        sql.append("DROP SCHEMA ");
        sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.name));
        if (this.sqlgGraph.getSqlDialect().supportsCascade()) {
            sql.append(" CASCADE");
        }
        if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
            sql.append(";");
        }
        if (logger.isDebugEnabled()) {
            logger.debug(sql.toString());
        }
        Connection conn = this.sqlgGraph.tx().getConnection();
        try (Statement stmt = conn.createStatement()) {
            stmt.execute(sql.toString());
        } catch (SQLException e) {
            logger.error("schema deletion failed " + this.sqlgGraph.toString(), e);
            throw new RuntimeException(e);
        }
    }
147607
def delete(sql_params = "", *bindvars)
      delete_sql = "DELETE FROM \"#{@schema_name}\".\"#{@table_name}\" "
      case sql_params
      when String
        delete_sql << sql_params
      when Hash
        raise ArgumentError, "Cannot specify bind variables when passing WHERE conditions as Hash" unless bindvars.empty?
        where_sqls = []
        sql_params.each do |k, v|
          where_sqls << "#{k} = :#{k}"
          bindvars << v
        end
        delete_sql << "WHERE " << where_sqls.join(" AND ") unless where_sqls.empty?
      else
        raise ArgumentError, "Only String or Hash can be provided as SQL condition argument"
      end
      @schema.execute(delete_sql, *bindvars)
    end
424811
def Close(self):
    """"""
    self.schema = {}

    if self._is_open:
      self._database.close()
    self._database = None

    if os.path.exists(self._temp_db_file_path):
      try:
        os.remove(self._temp_db_file_path)
      except (OSError, IOError) as exception:
        logger.warning((
            'Unable to remove temporary copy: {0:s} of SQLite database: '
            '{1:s} with error: {2!s}').format(
                self._temp_db_file_path, self._filename, exception))

    self._temp_db_file_path = ''

    if os.path.exists(self._temp_wal_file_path):
      try:
        os.remove(self._temp_wal_file_path)
      except (OSError, IOError) as exception:
        logger.warning((
            'Unable to remove temporary copy: {0:s} of SQLite database: '
            '{1:s} with error: {2!s}').format(
                self._temp_wal_file_path, self._filename, exception))

    self._temp_wal_file_path = ''

    self._is_open = False
477078
def deactivate():
    

    if hasattr(_mode, "current_state"):
        del _mode.current_state
    if hasattr(_mode, "schema"):
        del _mode.schema

    for k in connections:
        con = connections[k]
        if hasattr(con, 'reset_schema'):
            con.reset_schema()
409993
public void deleteByColumn(String schemaName, String tableName, String columnName, Object columnValue)
    {
        DBCollection dbCollection = mongoDb.getCollection(tableName);
        BasicDBObject query = new BasicDBObject();
        query.put(columnName, columnValue);
        KunderaCoreUtils.printQuery("Delete column:" + query, showQuery);
        dbCollection.remove(query, getWriteConcern(), encoder);
    }
629560
public void deleteByColumn(String schemaName, String tableName, String columnName, Object columnValue)
    {
        try
        {
            handler.deleteRow(columnValue, schemaName, tableName);
            KunderaCoreUtils.printQuery("Delete data from " + tableName + " for PK " + columnValue, showQuery);
        }
        catch (IOException ioex)
        {
            log.error("Error during get columns by key. Caused by: .", ioex);
            throw new PersistenceException(ioex);
        }
    }
17306
def delete_publication(self, pub_id, schema='upload'):
        
        if schema == 'upload':
            user = 'upload_admin'
        elif schema == 'public':
            user = 'catroot'

        if not self.user == 'catroot':
            assert self.user == user, \
                "You don't have permission to perform this operation"

        con = self.connection or self._connect()
        cur = con.cursor()

        self.stdout.write('Deleting publication: {pub_id} from {schema}\n'
                          .format(pub_id=pub_id, schema=schema))

        cur.execute("""SELECT to_regclass('keys');""")
        if cur.fetchone()[0] is not None:  # remove data from old tables
            old_tables = ['text_key_values', 'number_key_values',
                          'species', 'keys']
            for table in old_tables:
                cur.execute(
                    """DELETE FROM {schema}.{table}"""
                    .format(schema=schema,
                            table=table))

        cur.execute(
            """DELETE FROM {schema}.systems
            WHERE unique_id in
            (SELECT distinct ase_id
            FROM {schema}.publication_system
            WHERE pub_id = '{pub_id}')"""
            .format(schema=schema,
                    pub_id=pub_id))

        cur.execute(
            """ DELETE FROM {schema}.publication
            WHERE pub_id = '{pub_id}'"""
            .format(schema=schema,
                    pub_id=pub_id))

        self.stdout.write('Delete complete\n')

        if self.connection is None:
            con.commit()
            con.close()
        return
752365
def delete(self, key):
        """"""
        if not self.debug:
            self.database.delete(self.make_key(key))
1148809
@Override
    public void dropSchema()
    {
        try
        {
            for (TableInfo tableInfo : tableInfos)
            {
                HttpResponse deleteResponse = null;
                Map<String, MapReduce> views = new HashMap<String, MapReduce>();
                String id = CouchDBConstants.DESIGN + tableInfo.getTableName();
                CouchDBDesignDocument designDocument = getDesignDocument(id);
                designDocument.setLanguage(CouchDBConstants.LANGUAGE);
                views = designDocument.getViews();
                if (views != null)
                {
                    StringBuilder builder = new StringBuilder("rev=");
                    builder.append(designDocument.get_rev());
                    URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
                            CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase()
                                    + CouchDBConstants.URL_SEPARATOR + id, builder.toString(), null);
                    HttpDelete delete = new HttpDelete(uri);
                    try
                    {
                        deleteResponse = httpClient.execute(httpHost, delete, CouchDBUtils.getContext(httpHost));
                    }
                    finally
                    {
                        CouchDBUtils.closeContent(deleteResponse);
                    }
                }
            }
        }
        catch (Exception e)
        {
            logger.error("Error while creating database, caused by {}.", e);
            throw new SchemaGenerationException("Error while creating database", e, "couchDB");
        }
    }
1144531
public void deleteFromSchema(Mutation mutation, long timestamp)
    {
        ColumnFamily cf = mutation.addOrGet(CFMetaData.SchemaColumnsCf);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        // Note: we do want to use name.toString(), not name.bytes directly for backward compatibility (For CQL3, this won't make a difference).
        Composite prefix = CFMetaData.SchemaColumnsCf.comparator.make(cfName, name.toString());
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));
    }
974524
def delete_table(table_name):
    """"""
    to_delete = [
        make_key(table_name, rec['id'])
        for rec in read_by_indexes(table_name, [])
    ]

    with DatastoreTransaction() as tx:
        tx.get_commit_req().mutation.delete.extend(to_delete)
112049
def clear_db():
    """"""
    cursor = '0'
    while cursor != 0:
        cursor, keys = DB.scan(cursor, match='*', count=5000)
        if keys:
            DB.delete(*keys)
848831
def delete_table(self, schema, **kwargs):
        
        with self.connection(**kwargs) as connection:
            kwargs['connection'] = connection
            if not self.has_table(str(schema), **kwargs): return True
            with self.transaction(**kwargs):
                self._delete_table(schema, **kwargs)

        return True
273874
protected function removeDatabaseSchema(Connection $connection, DatabaseSchemaInterface $schema): void
    {
        $manager = $connection->getSchemaManager();

        if ($manager->tablesExist([$schema->getTokensScopesTable()]) === true) {
            $manager->dropTable($schema->getTokensScopesTable());
        }
        if ($manager->tablesExist([$schema->getClientsScopesTable()]) === true) {
            $manager->dropTable($schema->getClientsScopesTable());
        }
        if ($manager->tablesExist([$schema->getTokensTable()]) === true) {
            $manager->dropTable($schema->getTokensTable());
        }
        if ($manager->tablesExist([$schema->getRedirectUrisTable()]) === true) {
            $manager->dropTable($schema->getRedirectUrisTable());
        }
        if ($manager->tablesExist([$schema->getClientsTable()]) === true) {
            $manager->dropTable($schema->getClientsTable());
        }
        if ($manager->tablesExist([$schema->getScopesTable()]) === true) {
            $manager->dropTable($schema->getScopesTable());
        }
    }
937774
public void deleteByColumn(String schemaName, String tableName, String columnName, Object columnValue)
    {
        StringBuffer query = new StringBuffer();

        query.append("DELETE FROM ").append(getFromClause(schemaName, tableName)).append(" WHERE ").append(columnName)
                .append("=").append("'").append(columnValue).append("'");

        StatelessSession s = getStatelessSession();

        Transaction tx = onBegin();
        onNativeUpdate(query.toString(), null);
        onCommit(tx);

    }
78254
def remove(self, db):
        
        assert self.collection
        assert self.id

        db[self.collection].remove(self.id)
952379
public static void deleteSchema(GeoPackageCore geoPackage, String table) {

		DataColumnsDao dataColumnsDao = geoPackage.getDataColumnsDao();
		try {
			if (dataColumnsDao.isTableExists()) {
				dataColumnsDao.deleteByTableName(table);
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete Schema extension. GeoPackage: "
							+ geoPackage.getName() + ", Table: " + table, e);
		}

	}