Skip to content

Commit

Permalink
Update example of crud style api
Browse files Browse the repository at this point in the history
  • Loading branch information
etimr authored Aug 30, 2023
1 parent 03ee469 commit 9199ea2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions node.js/core-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -1080,12 +1080,12 @@ As an alternative to [`srv.run(query)`](#srv-run-query) you can use these conven
Essentially, they start constructing *bound* [`cds.ql` query objects](cds-ql) as follows:

```js
srv.read('Books',...)... --> SELECT.from ('Books',...)...
srv.create('Books',...)... --> INSERT.into ('Books',...)...
srv.insert('Books',...)... --> INSERT.into ('Books',...)...
srv.upsert('Books',...)... --> UPSERT.into ('Books',...)...
srv.update('Books',...)... --> UPDATE.entity ('Books',...)...
srv.delete('Books',...)... --> DELETE.from ('Books',...)...
srv.read('Books',...)... --> SELECT.from ('Books',...)...
srv.create('Books',...)... --> INSERT.into ('Books',...)...
srv.insert(...).into('Books')... --> INSERT.into ('Books',...)...
srv.upsert(...).into('Books')... --> UPSERT.into ('Books',...)...
srv.update('Books',...)... --> UPDATE.entity ('Books',...)...
srv.delete('Books',...)... --> DELETE.from ('Books',...)...
```

You can further construct the queries using the `cds.ql` fluent APIs, and then `await` them for execution thru `this.run()`. Here are some examples:
Expand Down

0 comments on commit 9199ea2

Please sign in to comment.