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
32 changes: 17 additions & 15 deletions .github/workflows/docker-image-early-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication
id-token: write # Required for OIDC authentication
contents: write # Required to create a new tag
steps:

Expand Down Expand Up @@ -72,7 +72,22 @@ jobs:
echo "The Early Access Release Docker Image build will pick it up from the target directory"


# CREATE GITHUB RELEASE AND ADD ASSETS
# CREATE GITHUB RELEASE
- id: create-release
name: Create GitHub early access release
uses: softprops/action-gh-release@v2
with:
target_commitish: ${{ github.sha }}
tag_name: early-access-release
token: ${{ secrets.GITHUB_TOKEN }}
name: early-access-release
draft: false
prerelease: true
body: |
SchemaCrawler AI early access release at last commit ${{ github.sha }}
generate_release_notes: true

# MOVE GITHUB TAG
- id: install-gitsign
name: Install gitsign for commit signing
# See https://github.com/chainguard-dev/actions/blob/main/setup-gitsign/action.yml
Expand All @@ -96,19 +111,6 @@ jobs:
git tag -a early-access-release -m "SchemaCrawler AI Early Access Release"
git push --follow-tags origin early-access-release
git show early-access-release
- id: create-release
name: Create GitHub early access release
uses: softprops/action-gh-release@v2
with:
target_commitish: ${{ github.sha }}
tag_name: early-access-release
token: ${{ secrets.GITHUB_TOKEN }}
name: early-access-release
draft: false
prerelease: true
body: |
SchemaCrawler AI early access release at last commit ${{ github.sha }}
generate_release_notes: true

# BUILD AND PUBLISH DOCKER IMAGE
- id: setup-qemu
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
build:
name: Create Release
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication
contents: write # Required to create a new tag
steps:

# VALIDATE TAGS
Expand Down Expand Up @@ -60,3 +63,28 @@ jobs:
body: |
SchemaCrawler AI ${{ github.event.release.tag_name }} release at last commit ${{ github.sha }}
generate_release_notes: true

# MOVE GITHUB TAG
- id: install-gitsign
name: Install gitsign for commit signing
# See https://github.com/chainguard-dev/actions/blob/main/setup-gitsign/action.yml
uses: chainguard-dev/actions/setup-gitsign@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d
- id: move-tag
name: Move docker-mcp-registry tag
env:
GITSIGN_CONNECTOR_ID: "https://github.com/login/oauth"
GITSIGN_TOKEN_PROVIDER: "github-actions"
shell: bash
run: |
# Move docker-mcp-registry tag
# Set up user
git config user.name "Sualeh Fatehi"
git config user.email "sualeh@hotmail.com"
# Confirm gitsign is installed
gitsign --version
# Move tag
git tag -d docker-mcp-registry || true
git push --delete origin docker-mcp-registry || true
git tag -a docker-mcp-registry -m "SchemaCrawler AI Early Access Release"
git push --follow-tags origin docker-mcp-registry
git show docker-mcp-registry
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ARG FROM_IMAGE=schemacrawler/schemacrawler:v17.1.6

# BUILDER stage - Build SchemaCrawler AI
FROM maven:3.9-eclipse-temurin-25 AS builder
FROM maven:3.9-eclipse-temurin-21 AS builder

# Copy source code
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion schemacrawler-ai-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>us.fatehi</groupId>
<artifactId>schemacrawler</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>us.fatehi</groupId>
<artifactId>schemacrawler-scripting</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

package schemacrawler.tools.ai.functions;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import java.util.ArrayList;
import java.util.Collection;
import schemacrawler.tools.ai.model.AdditionalRoutineDetails;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.FunctionReturnType;
import schemacrawler.tools.ai.tools.base.ParameterUtility;
import tools.jackson.databind.PropertyNamingStrategies;
import tools.jackson.databind.annotation.JsonNaming;
Expand Down Expand Up @@ -74,10 +72,4 @@ public AdditionalRoutineDetails toAdditionalRoutineDetails() {
public String toString() {
return ParameterUtility.parametersToString(this);
}

@JsonIgnore
@Override
public final FunctionReturnType getFunctionReturnType() {
return FunctionReturnType.JSON;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

package schemacrawler.tools.ai.functions;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import java.util.ArrayList;
import java.util.Collection;
import schemacrawler.tools.ai.model.AdditionalTableDetails;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.FunctionReturnType;
import schemacrawler.tools.ai.tools.base.ParameterUtility;
import tools.jackson.databind.PropertyNamingStrategies;
import tools.jackson.databind.annotation.JsonNaming;
Expand Down Expand Up @@ -81,10 +79,4 @@ public AdditionalTableDetails toAdditionalTableDetails() {
public String toString() {
return ParameterUtility.parametersToString(this);
}

@JsonIgnore
@Override
public final FunctionReturnType getFunctionReturnType() {
return FunctionReturnType.JSON;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@

package schemacrawler.tools.ai.functions;

import java.nio.file.Path;
import schemacrawler.inclusionrule.InclusionRule;
import schemacrawler.tools.ai.functions.DiagramFunctionParameters.DiagramType;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.base.AbstractExecutableFunctionExecutor;
import schemacrawler.tools.ai.tools.base.ExecutionParameters;
import schemacrawler.tools.options.Config;
import schemacrawler.tools.options.ConfigUtility;
import us.fatehi.utility.property.PropertyName;

public final class DiagramFunctionExecutor
Expand All @@ -22,18 +26,17 @@ protected DiagramFunctionExecutor(final PropertyName functionName) {
}

@Override
protected String getCommand() {
return "script";
public FunctionReturn call() {
final Config additionalConfig = createAdditionalConfig();
final InclusionRule grepTablesInclusionRule = makeInclusionRule(commandOptions.tableName());
final ExecutionParameters executionParameters =
new ExecutionParameters("script", additionalConfig, grepTablesInclusionRule, "text");
final Path outputFilePath = execute(executionParameters);
return returnText(outputFilePath);
}

@Override
protected InclusionRule grepTablesInclusionRule() {
return makeInclusionRule(commandOptions.tableName());
}

@Override
protected Config createAdditionalConfig() {
final Config additionalConfig = super.createAdditionalConfig();
private Config createAdditionalConfig() {
final Config additionalConfig = ConfigUtility.newConfig();

final DiagramType diagramType = commandOptions.diagramType();
additionalConfig.put("script-language", "python");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

package schemacrawler.tools.ai.functions;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.FunctionReturnType;
import schemacrawler.tools.ai.tools.base.ParameterUtility;
import tools.jackson.databind.PropertyNamingStrategies;
import tools.jackson.databind.annotation.JsonNaming;
Expand Down Expand Up @@ -48,7 +46,7 @@ public enum DiagramType {
private final String script;
private final String onlineEditorUrl;

private DiagramType(final String script, final String url) {
DiagramType(final String script, final String url) {
this.script = script;
onlineEditorUrl = url;
}
Expand All @@ -75,10 +73,4 @@ public String script() {
public String toString() {
return ParameterUtility.parametersToString(this);
}

@JsonIgnore
@Override
public final FunctionReturnType getFunctionReturnType() {
return FunctionReturnType.TEXT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

package schemacrawler.tools.ai.functions;

import java.nio.file.Path;
import schemacrawler.inclusionrule.InclusionRule;
import schemacrawler.tools.ai.tools.FunctionReturn;
import schemacrawler.tools.ai.tools.base.AbstractExecutableFunctionExecutor;
import schemacrawler.tools.ai.tools.base.ExecutionParameters;
import schemacrawler.tools.command.lint.options.LintReportOutputFormat;
import us.fatehi.utility.property.PropertyName;

public final class LintFunctionExecutor
Expand All @@ -20,12 +24,12 @@ protected LintFunctionExecutor(final PropertyName functionName) {
}

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

@Override
protected InclusionRule grepTablesInclusionRule() {
return makeInclusionRule(commandOptions.tableName());
public FunctionReturn call() {
final String outputFormat = LintReportOutputFormat.json.name();
final InclusionRule grepTablesInclusionRule = makeInclusionRule(commandOptions.tableName());
final ExecutionParameters executionParameters =
new ExecutionParameters("lint", grepTablesInclusionRule, outputFormat);
final Path outputFilePath = execute(executionParameters);
return returnJson(outputFilePath);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

package schemacrawler.tools.ai.functions;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.FunctionReturnType;
import schemacrawler.tools.ai.tools.base.ParameterUtility;
import tools.jackson.databind.PropertyNamingStrategies;
import tools.jackson.databind.annotation.JsonNaming;
Expand Down Expand Up @@ -41,10 +39,4 @@ table name (including the schema).
public String toString() {
return ParameterUtility.parametersToString(this);
}

@JsonIgnore
@Override
public FunctionReturnType getFunctionReturnType() {
return FunctionReturnType.JSON;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,14 @@ protected SchemaCrawlerOptions createSchemaCrawlerOptions() {
private ObjectNode createDependentObjectNode(
final DependantObjectType dependantObjectType, final DependantObject<Table> dependantObject) {

final Document document;
switch (dependantObjectType) {
case COLUMNS:
document = new ColumnDocument((Column) dependantObject, null);
break;
case INDEXES:
document = new IndexDocument((Index) dependantObject);
break;
case FOREIGN_KEYS:
document = new ForeignKeyDocument((ForeignKey) dependantObject);
break;
case TRIGGERS:
document = new TriggerDocument((Trigger) dependantObject);
break;
default:
document = null;
break;
}
final Document document =
switch (dependantObjectType) {
case COLUMNS -> new ColumnDocument((Column) dependantObject, null);
case INDEXES -> new IndexDocument((Index) dependantObject);
case FOREIGN_KEYS -> new ForeignKeyDocument((ForeignKey) dependantObject);
case TRIGGERS -> new TriggerDocument((Trigger) dependantObject);
default -> null;
};
if (document == null) {
return mapper.createObjectNode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

import static schemacrawler.tools.ai.functions.ListAcrossTablesFunctionParameters.DependantObjectType.NONE;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.FunctionReturnType;
import schemacrawler.tools.ai.tools.base.ParameterUtility;
import tools.jackson.databind.PropertyNamingStrategies;
import tools.jackson.databind.annotation.JsonNaming;
Expand Down Expand Up @@ -69,7 +67,7 @@ public enum DependantObjectType {

private final String nameAttribute;

private DependantObjectType(String nameAttribute) {
DependantObjectType(String nameAttribute) {
this.nameAttribute = nameAttribute;
}

Expand All @@ -82,10 +80,4 @@ public String nameAttribute() {
public String toString() {
return ParameterUtility.parametersToString(this);
}

@JsonIgnore
@Override
public final FunctionReturnType getFunctionReturnType() {
return FunctionReturnType.JSON;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@

import static schemacrawler.tools.ai.model.DatabaseObjectType.ALL;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import schemacrawler.tools.ai.model.DatabaseObjectType;
import schemacrawler.tools.ai.tools.FunctionParameters;
import schemacrawler.tools.ai.tools.FunctionReturnType;
import schemacrawler.tools.ai.tools.base.ParameterUtility;
import tools.jackson.databind.PropertyNamingStrategies;
import tools.jackson.databind.annotation.JsonNaming;
Expand Down Expand Up @@ -53,10 +51,4 @@ database object name (including the schema). May match
public String toString() {
return ParameterUtility.parametersToString(this);
}

@JsonIgnore
@Override
public final FunctionReturnType getFunctionReturnType() {
return FunctionReturnType.JSON;
}
}
Loading