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

sap-cf-capm-sqlite-persistence

v1.3.0

Published

This module allows you to persist data in the Object Store service when using an in-memory SQLite database in a SAP CAPM application. SQLite is an in-memory database and all data will be reset when the application is restarted.

Downloads

3

Readme

SAP-CF-CAPM-SQLITE-PERSISTENCE

This module allows you to persist data in the Object Store service when using an in-memory SQLite database in a SAP CAPM application. SQLite is an in-memory database and all data will be reset when the application is restarted.

If you want to create an application on SAP Cloud Platform using CAPM, but there is no HANA database available, you can use this module to persist your SQLite data.

How it works

There are two important functions in this module: backup and resore.

The backup function will extract all data from database entities that are annotated with @sql.dump:

@sql.dump
entity Employees {
key id : String(40);
jobCode : String(255);
firstName : String(255);
lastName : String(255);
hireDate : Date;
emailAddress : String(255);
}

It will serialize all this data into a large JSON object, which will be save in the object store service.

The restore function will read the serialized data from the object store service and upload it into the corresponding tables.

Backup

The backup function requires 3 parameters:

import { backup, restore, strategies } from  "sap-cf-capm-sqlite-persistence";
backup("<<datamodel namespace>>", "<<unique filename id>>", strategies.amazonS3);

| Parameter | Description | Example | |--|--|--| | Datamodel namespace | The namespace of your cds datamodel | com.sap.capm.datamodel | | unique id | A unique ID which will be used to save your file in the object store service | backupdata_dev backupdata_prd | Persistence strategy | Defines where the data will be saved, currently two strategies are available | strategies.amazonS3 localProject

The function returns a promise which will be resolved when the backup has been completed successfully.

Restore

import { backup, restore, strategies } from  "sap-cf-capm-sqlite-persistence";
restore("<<datamodel namespace>>", `<<unique filename id>>`, strategies.amazonS3)

| Parameter | Description | Example | |--|--|--| | Datamodel namespace | The namespace of your cds datamodel | com.sap.capm.datamodel | | unique id | A unique ID which will be used to read your file in the object store service | backupdata_dev backupdata_prd | Persistence strategy | Defines where the data will be read, currently two strategies are available | strategies.amazonS3 localProject The function returns a promise which will be resolved when the restore has been completed successfully.

Strategies

amazonS3

This strategy will use the SAP Cloud Platform Object Store service instance which is bound to your application. The serialized data will be saved as an object there.

localProject

This startegy will save the data in the project root folder as data.txt. The file can then be used to transfer it to an FTP drive/cloud storage/...