Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quagliato/spawl
SPAWL - Simple Persistence Abstraction Awesome Layer
https://github.com/quagliato/spawl
Last synced: 9 days ago
JSON representation
SPAWL - Simple Persistence Abstraction Awesome Layer
- Host: GitHub
- URL: https://github.com/quagliato/spawl
- Owner: quagliato
- License: mit
- Created: 2016-09-26T02:36:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T03:14:06.000Z (over 7 years ago)
- Last Synced: 2024-04-29T22:31:16.384Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.txt
- License: license.txt
Awesome Lists containing this project
README
# SPAWL
## Simple Persistence Abstraction Awesome Layer
I've started this "library" almost a year ago, to suply my need of fast switch
between database engines.So I've developed this package with an possibility of connecting to different
database engines through custom connectors.The first one was a MySQL/MariaDB connector, now I'm polishing a MongoDB
connector.## Example
This is an example using the MariaDB connector.
var SPAWLConnectorMariaDB = require('spawl-mariadb');
var SPAWL = require('spawl');var mariaDBConnector = new SPAWLConnectorMariaDB({
"DB\_HOST": "localhost",
"DB\_USER": "root",
"DB\_NAME": "example",
"DB\_PASS": ""
});var spawl = new SPAWL(mariaDBConnector);
var filter = {
"filter": {
"field": "field1",
"operator": "=",
"value": "1"
}
};var page = 1;
var pageSize = 20;var order = undefined;
spawl.get("entity", ["field1", "field2"], filter, order, page, pageSize, function(size, rows){
console.log(rows);
});## Connector
* MariaDB/MySQL - https://npmjs.org/spawl-mariadb
* MongoDB - https://npmjs.org/spawl-mongodb## Keep In Touch