npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cds-mysql

v7.9.0

Published

mysql database adapter for cds

Downloads

386

Readme

cds mysql

npm version node-test database-test

codecov Security Rating Technical Debt Vulnerabilities

MySQL/MariaDB adapter for CAP Framework, this module is heavily inspired by the cds-pg module.

Setup

firstly, install npm packages

npm i cds-mysql mysql2

setup the mysql database driver for cds -> edit the package.json > cds node (or .cdsrc.json)

{
  "requires": {
    "db": {
      "kind": "mysql"
    }
  }
}

create an .env file and put that into your local CDS project, then fill the database credential

CDS_REQUIRES_DB_CREDENTIALS_HOST=127.0.0.1
CDS_REQUIRES_DB_CREDENTIALS_PORT=3306
CDS_REQUIRES_DB_CREDENTIALS_DATABASE= # db name
CDS_REQUIRES_DB_CREDENTIALS_USER= # db user
CDS_REQUIRES_DB_CREDENTIALS_PASSWORD= # db user pwd!

now, start the cds server (npx cds-serve), everything is ready!

[!TIP] read more about how to config database credential.

[!TIP] read more about how to setup database user.


in addition, please check cap-mysql-sflight to get the mysql version of official cap-sflight example, and it works well.

Advanced Documentation

please read the full long version Advanced Documentation to get more technical details.

Feature and RoadMap

  • [x] fundamental INSERT/UPDATE/DELETE/SELECT query support
    • [x] support UPSERT by INSERT ... ON DUPLICATE KEY UPDATE statement
  • [x] deep insert for association/composition
    • [x] deep create/update/query/delete test case
  • [x] fiori draft support
    • [x] draftPrepare/draftEdit/draftActivate test case
  • [x] temporal aspect, but not support time-travel query
  • [x] incrementID auto incremental key aspect
  • [x] preDelivery CSV aspect
    • [x] migrate CSV on-demand (with option)
    • [x] CSV migration with hash check
    • [ ] care entity dependencies - the order of CSV import
  • [x] full text search
  • [x] schema migration optimization (ignore drop in some case)
    • [ ] ignore column length reduce and with warning
    • [x] model version, only incremental migration - transparent migration
  • [x] @Core.Media attachment support
  • [x] localized data
  • [x] multi tenancy
    • [x] deploy model on-fly
    • [x] create database on-demand
      • [ ] user permission check
    • [x] experimental @sap/cds-mtxs support -> document - behavior maybe changed later.
      • [x] extensibility (pull/push)
  • [x] $expand navigation
  • [x] $filter with canonical functions (concat/contains/substring)
  • [x] test with mariadb 10, mysql 5/8
  • [x] initial data provision by CSV
    • [x] better migration type/column/name adaption
  • [x] mysql index
    • [ ] better error for not supported elements
  • [x] automatically schema sync (when connection pool provision)
  • [x] SELECT FOR UPDATE/LOCK IN SHARE MODE
    • [ ] NOWAIT support
    • [ ] SKIP LOCKED support
  • [x] better E2E document/sample - cap-mysql-sflight
  • [ ] adapt new cds-dbs layer
  • [ ] real stream adoption for binary

CHANGELOG

LICENSE