Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ========================================================================

# Provided arguments
ARG FROM_IMAGE=schemacrawler/schemacrawler:v17.1.1
ARG FROM_IMAGE=schemacrawler/schemacrawler:v17.1.3

# BUILDER stage - Build SchemaCrawler AI
FROM maven:3.9-eclipse-temurin-25 AS builder
Expand Down
10 changes: 8 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

SchemaCrawler AI release notes.

<a name="v17.1.1-2"></a>
## Release 16.28.2-2 - 2025-09-29
<a name="v17.1.3-1"></a>
## Release 17.1.3-1 - 2025-09-29

- Build against latest SchemaCrawler version


<a name="16.29.1-1"></a>
## Release 16.29.1-1 - 2025-09-29

- Remove "aichat" command

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>us.fatehi</groupId>
<artifactId>schemacrawler-ai-aggregator</artifactId>
<version>17.1.1-1</version>
<version>17.1.3-1</version>
<packaging>pom</packaging>
<name>SchemaCrawler AI [Aggregator]</name>

Expand Down
12 changes: 3 additions & 9 deletions schemacrawler-ai-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>us.fatehi</groupId>
<artifactId>schemacrawler-ai-parent</artifactId>
<version>17.1.1-1</version>
<version>17.1.3-1</version>
<relativePath>../schemacrawler-ai-parent</relativePath>
</parent>
<artifactId>schemacrawler-ai-core</artifactId>
Expand Down Expand Up @@ -50,14 +50,8 @@
</dependency>
<dependency>
<groupId>us.fatehi</groupId>
<artifactId>schemacrawler-api</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>us.fatehi</groupId>
<artifactId>schemacrawler-tools</artifactId>
<type>test-jar</type>
<artifactId>schemacrawler-test-utility</artifactId>
<version>${schemacrawler.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@
package schemacrawler.tools.ai.functions;

import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.tools.ai.tools.AbstractSchemaCrawlerFunctionExecutor;
import schemacrawler.tools.ai.tools.AbstractFunctionExecutor;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.JsonFunctionReturn;
import schemacrawler.utility.MetaDataUtility;
import us.fatehi.utility.property.PropertyName;

public abstract class AbstractJsonFunctionExecutor<P extends FunctionParameters>
extends AbstractSchemaCrawlerFunctionExecutor<P> {
extends AbstractFunctionExecutor<P> {

protected AbstractJsonFunctionExecutor(final PropertyName functionName) {
super(functionName);
}

@Override
public abstract JsonFunctionReturn call() throws Exception;

protected final void refilterCatalog() {
final SchemaCrawlerOptions options = createSchemaCrawlerOptions();
MetaDataUtility.reduceCatalog(catalog, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import schemacrawler.tools.ai.model.AdditionalRoutineDetails;
import schemacrawler.tools.ai.model.CatalogDocument;
import schemacrawler.tools.ai.model.CompactCatalogUtility;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.JsonFunctionReturn;
import us.fatehi.utility.property.PropertyName;

Expand All @@ -35,7 +34,7 @@ protected DescribeRoutinesFunctionExecutor(final PropertyName functionName) {
}

@Override
public FunctionReturn call() throws Exception {
public JsonFunctionReturn call() throws Exception {
refilterCatalog();

final Collection<AdditionalRoutineDetails> routineDetails = getRoutineDetails();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import schemacrawler.tools.ai.model.AdditionalTableDetails;
import schemacrawler.tools.ai.model.CatalogDocument;
import schemacrawler.tools.ai.model.CompactCatalogUtility;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.JsonFunctionReturn;
import us.fatehi.utility.property.PropertyName;

Expand All @@ -34,7 +33,7 @@ protected DescribeTablesFunctionExecutor(final PropertyName functionName) {
}

@Override
public FunctionReturn call() throws Exception {
public JsonFunctionReturn call() throws Exception {
refilterCatalog();

final Collection<AdditionalTableDetails> tableDetails = getTableDetails();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@

package schemacrawler.tools.ai.functions;

import schemacrawler.inclusionrule.ExcludeAll;
import schemacrawler.inclusionrule.InclusionRule;
import schemacrawler.schemacrawler.GrepOptionsBuilder;
import schemacrawler.schemacrawler.LimitOptionsBuilder;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.tools.ai.tools.AbstractExecutableFunctionExecutor;
import schemacrawler.tools.command.text.schema.options.SchemaTextOptionsBuilder;
import schemacrawler.tools.options.Config;
import us.fatehi.utility.property.PropertyName;

public final class LintFunctionExecutor
Expand All @@ -26,39 +19,13 @@ protected LintFunctionExecutor(final PropertyName functionName) {
super(functionName);
}

@Override
public boolean usesConnection() {
return true;
}

@Override
protected Config createAdditionalConfig() {
final SchemaTextOptionsBuilder schemaTextOptionsBuilder = SchemaTextOptionsBuilder.builder();
return schemaTextOptionsBuilder.noInfo().toConfig();
}

@Override
protected SchemaCrawlerOptions createSchemaCrawlerOptions() {
final LimitOptionsBuilder limitOptionsBuilder =
LimitOptionsBuilder.builder()
.includeSynonyms(new ExcludeAll())
.includeSequences(new ExcludeAll())
.includeRoutines(new ExcludeAll());
final InclusionRule grepTablesPattern = makeInclusionRule(commandOptions.tableName());
final GrepOptionsBuilder grepOptionsBuilder =
GrepOptionsBuilder.builder().includeGreppedTables(grepTablesPattern);
return SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions()
.withLimitOptions(limitOptionsBuilder.toOptions())
.withGrepOptions(grepOptionsBuilder.toOptions());
}

@Override
protected String getCommand() {
return "lint";
}

@Override
protected boolean hasResults() {
return !catalog.getTables().isEmpty();
protected InclusionRule grepTablesInclusionRule() {
return makeInclusionRule(commandOptions.tableName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import schemacrawler.tools.ai.model.ForeignKeyDocument;
import schemacrawler.tools.ai.model.IndexDocument;
import schemacrawler.tools.ai.model.TriggerDocument;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.JsonFunctionReturn;
import us.fatehi.utility.property.PropertyName;

Expand All @@ -45,7 +44,7 @@ protected ListAcrossTablesFunctionExecutor(final PropertyName functionName) {
}

@Override
public FunctionReturn call() throws Exception {
public JsonFunctionReturn call() throws Exception {
refilterCatalog();

final Collection<DependantObject<Table>> dependantObjects = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.tools.ai.model.DatabaseObjectDocument;
import schemacrawler.tools.ai.model.DatabaseObjectType;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.JsonFunctionReturn;
import us.fatehi.utility.property.PropertyName;

Expand All @@ -36,7 +35,7 @@ protected ListFunctionExecutor(final PropertyName functionName) {
}

@Override
public FunctionReturn call() throws Exception {
public JsonFunctionReturn call() throws Exception {
refilterCatalog();

final Collection<DatabaseObject> databaseObjects = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Collection;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.JsonFunctionReturn;
import schemacrawler.tools.ai.tools.NoParameters;
import us.fatehi.utility.property.Property;
Expand All @@ -30,7 +29,7 @@ protected ServerInformationFunctionExecutor(final PropertyName functionName) {
}

@Override
public FunctionReturn call() throws Exception {
public JsonFunctionReturn call() throws Exception {
// No need to refilter, but leave this boilerplate
// refilterCatalog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@

package schemacrawler.tools.ai.functions;

import schemacrawler.inclusionrule.ExcludeAll;
import schemacrawler.inclusionrule.InclusionRule;
import schemacrawler.schemacrawler.GrepOptionsBuilder;
import schemacrawler.schemacrawler.LimitOptionsBuilder;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.tools.ai.tools.AbstractExecutableFunctionExecutor;
import schemacrawler.tools.command.text.schema.options.SchemaTextOptionsBuilder;
import schemacrawler.tools.options.Config;
import us.fatehi.utility.property.PropertyName;

public final class TableSampleFunctionExecutor
Expand All @@ -26,39 +19,13 @@ protected TableSampleFunctionExecutor(final PropertyName functionName) {
super(functionName);
}

@Override
public boolean usesConnection() {
return true;
}

@Override
protected Config createAdditionalConfig() {
final SchemaTextOptionsBuilder schemaTextOptionsBuilder = SchemaTextOptionsBuilder.builder();
return schemaTextOptionsBuilder.noInfo().toConfig();
}

@Override
protected SchemaCrawlerOptions createSchemaCrawlerOptions() {
final LimitOptionsBuilder limitOptionsBuilder =
LimitOptionsBuilder.builder()
.includeSynonyms(new ExcludeAll())
.includeSequences(new ExcludeAll())
.includeRoutines(new ExcludeAll());
final InclusionRule grepTablesPattern = makeInclusionRule(commandOptions.tableName());
final GrepOptionsBuilder grepOptionsBuilder =
GrepOptionsBuilder.builder().includeGreppedTables(grepTablesPattern);
return SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions()
.withLimitOptions(limitOptionsBuilder.toOptions())
.withGrepOptions(grepOptionsBuilder.toOptions());
}

@Override
protected String getCommand() {
return "tablesample";
}

@Override
protected boolean hasResults() {
return !catalog.getTables().isEmpty();
protected InclusionRule grepTablesInclusionRule() {
return makeInclusionRule(commandOptions.tableName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
import java.io.StringWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import schemacrawler.inclusionrule.ExcludeAll;
import schemacrawler.inclusionrule.InclusionRule;
import schemacrawler.schemacrawler.GrepOptionsBuilder;
import schemacrawler.schemacrawler.LimitOptionsBuilder;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.tools.command.text.schema.options.SchemaTextOptionsBuilder;
import schemacrawler.tools.executable.SchemaCrawlerExecutable;
import schemacrawler.tools.options.Config;
import schemacrawler.tools.options.OutputOptions;
Expand All @@ -27,7 +33,7 @@
import us.fatehi.utility.string.StringFormat;

public abstract class AbstractExecutableFunctionExecutor<P extends FunctionParameters>
extends AbstractSchemaCrawlerFunctionExecutor<P> {
extends AbstractFunctionExecutor<P> {

private static final Logger LOGGER =
Logger.getLogger(AbstractExecutableFunctionExecutor.class.getCanonicalName());
Expand Down Expand Up @@ -87,11 +93,38 @@ public final FunctionReturn call() {
}
}

protected abstract Config createAdditionalConfig();
@Override
public boolean usesConnection() {
return true;
}

protected Config createAdditionalConfig() {
final SchemaTextOptionsBuilder schemaTextOptionsBuilder = SchemaTextOptionsBuilder.builder();
return schemaTextOptionsBuilder.noInfo().toConfig();
}

@Override
protected SchemaCrawlerOptions createSchemaCrawlerOptions() {
final LimitOptionsBuilder limitOptionsBuilder =
LimitOptionsBuilder.builder()
.includeSynonyms(new ExcludeAll())
.includeSequences(new ExcludeAll())
.includeRoutines(new ExcludeAll());
final InclusionRule grepTablesPattern = grepTablesInclusionRule();
final GrepOptionsBuilder grepOptionsBuilder =
GrepOptionsBuilder.builder().includeGreppedTables(grepTablesPattern);
return SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions()
.withLimitOptions(limitOptionsBuilder.toOptions())
.withGrepOptions(grepOptionsBuilder.toOptions());
}

protected abstract String getCommand();

protected abstract boolean hasResults();
protected abstract InclusionRule grepTablesInclusionRule();

protected boolean hasResults() {
return !catalog.getTables().isEmpty();
}

private SchemaCrawlerExecutable createExecutable() {

Expand Down
Loading