cancel
Showing results for 
Search instead for 
Did you mean: 

Tutorial Create a CAP Business Service with Node.js Using Visual Studio Code Step 8 and Step 9

AndreasMuno
Product and Topic Expert
Product and Topic Expert
0 Kudos

Tutorials: https://developers.sap.com/tutorials/cp-apm-nodejs-create-service.html
--------------------------

Thank you, rene.jeglinsky, chuergo16 , daniel.wroblewski , joshua.margo, for this beautiful tutorial!

I got successful to step 7, and thought I had accomplished step 8 with the persistent database. However, the cds appears to not catch the persistent database. It keeps referring to the in-memory database when entering
C:\Users\<myuserId>\my-bookshop>cds watch:

Before that, the command

C:\Users\<myuserId>\my-bookshop>C:\sqlite\sqlite3 db/my-bookshop.db -cmd .dump

appeared to work out with this set of tables getting created:

etcetera...

...ending with a successful looking

Where did things go wrong?

Is this why the custom logic for ordering books won't work? I'm getting a response code 204 "No content" and the stock of "Wuthering Heights" remains at 12.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
Active Contributor

Hi Andreas,

it seems that with CAP 7 the command

cds deploy --to sqlite:db/my-bookshop.db

doesn't update the package.json anymore. So it seems you need to follow the documentation Custom Configuration and add this manually to your package.json:

  "cds": {
    "requires": {
      "db": {
        "kind": "sqlite",
        "impl": "@cap-js/sqlite",
        "credentials": {
          "url": "db/my-bookshop.db"
        }
      }
    }
  }

Then try again after you've added the custom logic of step 10.

Best Regards
Gregor

AndreasMuno
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you, gregorw , that insert got the cds watch to properly reflect the persistent database. I might be entering a separate question on the custom logic which still doesn't allow for the ordering of books, but will first perform a few more tests and try to figure things out. Thank you.

Answers (0)