Skip to content

feat: mle-ts-ords-backend template #301 #302

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 6 commits into
base: main
Choose a base branch
from

Conversation

DimaNike
Copy link
Member

@DimaNike DimaNike commented Jun 5, 2025

[PR] MLE ORDS BACKEND TEMPLATE

## Description
Introduces new MLE template that uses existing mle-ts-sample as backend logic and adds ORDS configuration to expose existing logic as REST endpoint.

Fixes #301 

## 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 Jun 5, 2025
Copy link
Member

@LeonSilva15 LeonSilva15 left a comment

Choose a reason for hiding this comment

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

great documentation @DimaNike, thanks!


- [Oracle Database 23ai](https://www.oracle.com/database/) or Oracle Database Free (provided via Docker Compose).
- [Oracle REST Data Services](https://www.oracle.com/database/technologies/appdev/rest.html) (ORDS, configured for database access).
- [SQLcl](https://www.oracle.com/database/sqldeveloper/technologies/sqlcl) for deploying MLE modules.
Copy link
Member

Choose a reason for hiding this comment

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

When testing we didn't find any real reference to SQLcl, so my question is, can we remove this dependency? If so, it would also need to be removed from the CLI wizard.

Object.assign( configObject, {
ordsHost: ordsHost === '' ? await input(
{
message: 'Please provide ORDS Base URL: ',
Copy link
Member

Choose a reason for hiding this comment

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

If the ORDS base path provided contains a slash at the end, the BASE_URL for tests generates something like <my_hostname>/ords//<my_db_user> with a double slash which makes tests fail (test/rest.test.js)


Follow the general steps in the [mle-ts-sample/README](../mle-ts-sample/README.md#getting-started) to create your project, but **choose `mle-ts-ords-backend` as the template** during `@create-database-app` initialization.

### 2. (Optional) Start Development Environment with Docker Compose
Copy link
Member

@LeonSilva15 LeonSilva15 Jul 5, 2025

Choose a reason for hiding this comment

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

Running the docker-compose up throws a permissions error:

Gracefully stopping... (press Ctrl+C again to force)
Error response from daemon: error while creating mount source path 'create-database-app/templates/mle-ts-ords-backend/ords/config': chown create-database-app/templates/mle-ts-ords-backend/ords/config: permission denied

we need to add this step or caveat informing chmod can fix this: chmod -R 770 create-database-app/templates/mle-ts-ords-backend/ or execute with sudo / as admin

  • Would be nice to also have the path to the docker-compose.yml (create-database-app/templates/mle-ts-ords-backend) so the users can know where to go to run this command

@@ -540,7 +554,8 @@ export default class Generate extends Command {
} );
}

if(templateChoice == 'mle-ts-sample'){
if(templateChoice == 'mle-ts-sample' || templateChoice == 'mle-ts-ords-backend')
Copy link
Member

Choose a reason for hiding this comment

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

Please use strict comparison === instead

@@ -552,6 +567,21 @@ export default class Generate extends Command {
},
) : sqlclPath
});
if (templateChoice == 'mle-ts-ords-backend')
Copy link
Member

Choose a reason for hiding this comment

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

Please use strict comparison === instead

- `db23` - Oracle Database 23 Free
- `ords-node1` - ORDS server configured to use `db23`

See the `docker-compose.yml` file (and its comments) for configuration options.
Copy link
Member

Choose a reason for hiding this comment

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

it'd also be really valuable if here we ask the user to create a user and grant the required permissions or create one for them.
What we did was create one of our own and grant:
CONNECT, DBA, PDB_DBA, SYSDBA, and EXECUTE ON JAVASCRIPT

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