Skip to content

feat: add MLE application template #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

DimaNike
Copy link
Member

@DimaNike DimaNike commented Apr 8, 2025

[PR] [Enhancement] MLE application template #255

## Description
mle-app template can be used to generate MLE basic application that can be built and deployed to the database. Database credentials should be provided via existing mechanism by answering questions during the application creation process. In addition, MLE application template requires SQLcl path to be specified.

Fixes #255

## Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

## Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings/errors
- [n/a] I have added tests that prove my fix is effective or that my feature works
- [n/a] New and existing unit tests pass locally with my changes

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 8, 2025
@dbtools-antcampo dbtools-antcampo self-assigned this Apr 8, 2025
# Database User Password
DB_PASSWORD=<%= connectionPassword %>
# Connection string to your Autonomous Database/
# Oracle Database Free instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might create confusion for users since the connection will not necessarily be to a free DB instance.

# Connection string to your Autonomous Database/
# Oracle Database Free instance
CONNECT_STRING=<%= connectionString %>
MLE_MODULE=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is empty and does not have a replacement token, is this expected?

@@ -207,7 +207,7 @@ export default class Generate extends Command {
'template': Flags.string({
char: 't',
description: 'Template to use',
options: ['node-vanilla', 'node-react', 'node-vue', 'node-react-todo', 'node-jet', 'node-angular', 'ords-remix-jwt-sample'],
options: ['node-vanilla', 'node-react', 'node-vue', 'node-react-todo', 'node-jet', 'node-angular', 'ords-remix-jwt-sample', 'mle-js-basic'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to adjust the template name to have consistency with other templates and be more explicit on it's main functionality, a few proposals I have in mind:

  • mle-ts-sample
  • mle-deployment-sample
  • mle-todo
  • mle-todo-sample

@@ -188,3 +188,8 @@ updates:
- "templates-ords-remix"
commit-message:
prefix: fix(deps)

- package-ecosystem: "npm"
directory: "/templates/mle-js-basic/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the template name is defined, I'll create a label on the project so that PRs created by dependabot can be easily filtered.
This will require a minor change here, but let's define that other item first.

}

console.log(`Executing: ${filePath}...`);
const sqlclCommand = `"${sqlExecutable}" -S /nolog <<'EOF'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding SQLcl, one of the concerns raised when discussing with the team is the fact that this:

  1. This adds external dependencies.
  2. Users who are not used to the Oracle ecosystem will probably not have SQLcl installed on their system, which represents a barrier to the use of the template.
  3. We should explore the possibility of performing deployments using the node-oracledb driver as other templates do in the project for the DB connection.

For additional context: the objective of this generator is to help newcomers to the Oracle ecosystem by automating repetitive boilerplate tasks, eliminating setup friction, and accelerating onboarding, that why SQLcl is a concern for us.

@mig8447 @LeonSilva15

"scripts": {
"build": "esbuild src/index.ts --bundle --minify=false --platform=neutral --format=esm --outfile=dist/index.js",
"deploy": "node deploy.mjs",
"initdb": "node utils/db.mjs utils/database/initdb.sql",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does initdb handle the case where objects are already in the DB but the cleandb has not been run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants