Skip to content

[0.4.6] 版本更新: Metadata读取

Compare
Choose a tag to compare
@CarmJos CarmJos released this 16 Aug 19:22
· 91 commits to master since this release
Metadata快捷操作实例
public class EasySQLDemo {

    public void metadata(SQLManager sql) {

        // 操作数据库元数据,直接返回结果。
        CompletableFuture<Boolean> roFuture = sql.fetchMetadata(DatabaseMetaData::isReadOnly);
        CompletableFuture<Integer> maxColumnFuture = sql.fetchMetadata(DatabaseMetaData::getMaxColumnsInSelect);

        // 操作有 ResultSet 元数据。该方法会自动关闭ResultSet。
        CompletableFuture<Boolean> tableExists = sql.fetchMetadata(
                meta -> meta.getTables(null, null, "表名", new String[]{"TABKE"}),
                resultSet -> resultSet.next()
        );

        // SQLManager附带了几个常用元数据的获取方法。
        CompletableFuture<Boolean> tableExists2 = sql.fetchTableMetadata("表名").validateExist();
        CompletableFuture<Boolean> columnExists = sql.fetchTableMetadata("表名").isColumnExists("字段名");
        // 更多方法详见 TableMetadataBuilder 。
    }


}

What's Changed

  • chore(deps): bump maven-javadoc-plugin from 3.4.0 to 3.4.1 by @dependabot in #58

Full Changelog: 0.4.5...0.4.6