{"id":19584713,"url":"https://github.com/oracle-samples/oracleadapter-parse","last_synced_at":"2025-04-27T11:32:16.085Z","repository":{"id":203556703,"uuid":"708982626","full_name":"oracle-samples/oracleadapter-parse","owner":"oracle-samples","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-28T17:31:11.000Z","size":437,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-28T17:31:52.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-23T19:22:52.000Z","updated_at":"2024-10-28T14:58:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"d373fa63-4332-40f4-9250-104ccac46f54","html_url":"https://github.com/oracle-samples/oracleadapter-parse","commit_stats":null,"previous_names":["oracle-samples/oracleadapter-parse"],"tags_count":0,"template":false,"template_full_name":"oracle/template-repo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Foracleadapter-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Foracleadapter-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Foracleadapter-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-samples%2Foracleadapter-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle-samples","download_url":"https://codeload.github.com/oracle-samples/oracleadapter-parse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224069554,"owners_count":17250454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T07:49:26.196Z","updated_at":"2024-11-11T07:49:27.076Z","avatar_url":"https://github.com/oracle-samples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oracle Storage Adapter for Parse Server\n\nThis document describes how to build and run [Parse Server](https://parseplatform.org/) with the new Oracle storage adapter based on the [Oracle NodeJS libraries](https://node-oracledb.readthedocs.io/en/latest). It will demonstrate running against the [Free Oracle Database 23ai Docker container](https://www.oracle.com/database/free) and the [JSON Autonomoumous database](https://www.oracle.com/autonomous-database/autonomous-json-database/) in the cloud. \n\n## Prerequisites\n\nThe Oracle SQL client is a software application that allows users to connect to an Oracle database and execute queries and manage the database.\n\n[SQL Client](https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/download/)\n\nThe Oracle Instant Client is a set of software libraries that allow users to connect to an Oracle database without a full Oracle database installation.\n\n[Instant Client Libraries](https://www.oracle.com/database/technologies/instant-client/downloads.html)\n\n## Installation\n[Apple Silicon Installation](./AppleARM.md) otherwise continue below\n\nClone [Parse Server Repository](https://github.com/parse-community/parse-server). Supported version 7.3.0 and above.  \n\nThere were changes in this release that supported:\n\n1. [Test Exclusion List](https://github.com/parse-community/parse-server/pull/8774)\n2. [Dynamic Database Adapter configuration](https://github.com/parse-community/parse-server/pull/8883)\n\n```\ngit clone --depth 1 --branch 7.3.0 https://github.com/parse-community/parse-server.git\ncd parse-server\n```\n2. Clone this Oracle Samples repo into src/Adapters/Storage/Oracle\n ```\ncd src/Adapters/Storage\ngit clone https://github.com/oracle-samples/oracleadapter-parse.git Oracle\ncd Oracle\nrm -rf .git    # IMPORTANT or build will fail\ncd ../../../.. # Go back to Project Root\n```\n\n\n## Getting Started\n### Building Parse with Oracle Storage Adapter\n1. Add the Oracle database dependency\n\n    ```\n    npm install oracledb@6.6.0\n    ```\n\n    [Quick Start node-oracledb Installation](https://node-oracledb.readthedocs.io/en/latest/user_guide/installation.html#quick-start-node-oracledb-installation)\n\n2. Add the Parse File Adapter dependency\n\n    ```\n    npm install --save @parse/fs-files-adapter\n    ```\n\n    This defaults to local storage. \n\n    [Parse Server File Storage Adapter Repository](https://github.com/parse-community/parse-server-fs-adapter)\n\n3. Run \n    ```\n    npm ci\n    ``` \n    to build the server\n\n## How To Run\n### Configuring Free23ai Oracle database image\n1. Get and Start the image\n\n    ```\n    docker run --name free23ai -d -p 1521:1521 -e ORACLE_PWD=Welcome12345 container-registry.oracle.com/database/free:latest\n    ```\n\n   It takes about a minute for the image to reach a healthy state on my MacBook\n\n2. Connect to the image as sysdba\n\n    ```\n    sql sys/Welcome12345@localhost:1521/freepdb1 as sysdba\n    ```\n\n   and run the following commands to enable JSON support\n\n    ```\n    alter session set container=FREEPDB1;\n    grant db_developer_role to pdbadmin;\n    grant soda_app to pdbadmin;\n    GRANT UNLIMITED TABLESPACE TO pdbadmin;\n    quit;\n    ```\n\n    or run the commands as a script. Create a file called `soda` that contains the above commands\n\n    ```\n    sql sys/Welcome12345@localhost:1521/freepdb1 as sysdba @./soda\n    ```\n\n### Run Parse Server\n1. Create a config.json.  This is a minimal set of [configuration parameters](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html) for booting the server. The databaseURI is configured to attach to the local 23ai Oracle Database instance.\n\n```\n{\n  \"appId\": \"APPLICATION_ID\",\n  \"masterKey\": \"MASTER_KEY\",\n  \"allowClientClassCreation\": true,\n  \"port\": 1338,\n  \"logLevel\": \"info\",\n  \"verbose\": false,\n  \"mountGraphQL\": true,\n  \"mountPlayground\": true,\n  \"graphQLPath\": \"/graphql\",\n  \"filesAdapter\": {\n    \"module\": \"@parse/fs-files-adapter\"\n  },\n  \"databaseAdapter\": {\n    \"module\": \"./Storage/Oracle/OracleStorageAdapter\",\n    \"options\": {\n      \"databaseURI\": \"oracledb://pdbadmin:Welcome12345@localhost:1521/freepdb1\",\n      \"collectionPrefix\": \"\"\n    }\n  }\n}  \n```\n\n2. If using an Oracle Instant Client prior to 23ai. I am running on MacOS Intel and the most recent Instant Client for that platform is 19_16 so export the variable below.\n```\nexport ORACLEDB_VERSION=19\n```\n\n3. Boot the Server using the Oracle Instant Client location\n\n```\nORACLE_CLIENT_LOCATION=/Users/myuser/instantclient_19_16  npm start -- ./config.json\n```\n\n\n### Test the Local Stack\n1. Run a curl command\n\n    ```\n    curl -X POST -H \"X-Parse-Application-Id: APPLICATION_ID\" -H \"Content-Type: application/json\" -d '{\"score\":12,\"playerName\":\"scooby\",\"cheatmode\":false}' http://localhost:1338/parse/classes/GameScore\n    ```\n\n   Upon success\n\n    ```\n    {\"objectId\":\"CdmLJT6Duc\",\"createdAt\":\"2023-10-16T19:33:27.382Z\"}\n    ```\n\n2. Connect to the database and verify\n\n    ```\n    sql pdbadmin/Welcome12345@localhost:1521/FREEPDB1\n    ```\n\n3. Run SODA commands\n\n    ```\n    SQL\u003e soda list\n    List of collections:\n\n\tGameScore\n\t_Hooks\n\t_Idempotency\n\t_Role\n\t_SCHEMA\n\t_User\n\n    SQL\u003e soda get GameScore\n\tKEY\t\t\t\t\t\t                Created On\n\n\t3A8CB47A41A74F59BFDD143A3F365F4A\t\t2023-10-16T19:33:27.404374000Z\n\n    1 row selected. \n\n    SQL\u003e soda get GameScore -k 3A8CB47A41A74F59BFDD143A3F365F4A\n\n    Key:    \t 3A8CB47A41A74F59BFDD143A3F365F4A\n    Content:\t {\"score\":12,\"playerName\":\"scooby\",\"cheatmode\":false,\"updatedAt\":\"2023-10-16T19:33:27.382Z\",\"createdAt\":\"2023-10-16T19:33:27.382Z\",\"_id\":\"CdmLJT6Duc\"}\n\n    1 row selected. \n\n\n     soda help – list all soda commands\n\n    ```\n\n \n### Running against Autonomous Database in the cloud\n1. Update databaseAdapter.options.databaseURI in config.json to point at the cloud database instance\n\n    ``` \n    \"databaseURI\": \"oracledb://username:password@tnsname\",\n    ```\n\n2. Download the cloud database wallet and use it when starting the server\n\n    ```\n    ORACLE_CLIENT_LOCATION=/Users/myuser/instantclient_19_16 ORACLE_WALLET_LOCATION=/Users/myuser/wallet-oradb  npm start -- ./config.json\n    ```\n\n\n## Cloud Code\n[Use Cloud Code to call Custom Oracle PL/SQL](./cloud/README.md)\n\n\n## Contributing\n\nThis project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)\n\n## Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process\n\n## License\n\nCopyright (c) 2024 Oracle and/or its affiliates.\n\nReleased under the Universal Permissive License v1.0 as shown at\n\u003chttps://oss.oracle.com/licenses/upl/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-samples%2Foracleadapter-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle-samples%2Foracleadapter-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-samples%2Foracleadapter-parse/lists"}