How to use the function in sharedb

To help you get started, we’ve selected a few sharedb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WinMinTun / sharedb-mysql / index.js View on Github external
function MySQLDB(options) {
	if (!(this instanceof MySQLDB)) return new MySQLDB(options);, options);

	this.closed = false;

	mysql_config = options.db;

	// connections in pool
	mysql_config.connectionLimit = options.db.connectionLimit ? options.connectionLimit : 10;
	pool  = mysql.createPool(mysql_config);

	if (options.debug) {
		debug = options.debug;
		pool.on('acquire', function (connection) {
			console.log('Connection %d acquired', connection.threadId);
github share / sharedb-postgres / index.js View on Github external
function PostgresDB(options) {
  if (!(this instanceof PostgresDB)) return new PostgresDB(options);, options);

  this.closed = false;

  this.pg_config = options;
module.exports = PostgresDB;