0.6.0 • Published 8 years ago

concava-adapter-mysql v0.6.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

ConCaVa MySQL adapter

ConCaVa adapter for authorization, metadata and storage through MySQL.

Requires ConCaVa v0.6+.

Note: The MQTT server is lazy loaded, so it becomes available after processing the first sensor data.

See ConCaVa with MySQL and InfluxDB for a working setup.

Install

npm install concava-adapter-mysql

Configure

A ConCaVa configuration example:

const adapter = require('concava-adapter-mysql')

// Connection configuration
var config = {
	host: 'mysql',
	user: process.env['MYSQL_USER'],
	password: process.env['MYSQL_PASS'],
	database: process.env['ON_CREATE_DB'],
	timeout: 3000, // ms
}

module.exports = {
	debug: true,
	auth: {
		enabled: true,
		method: adapter.auth,
		config: config,
		sql: '', // Custom query
	},
	metadata: {
		method: adapter.metadata,
		config: config,
		attributeSql: '', // Custom query
		converterSql: '', // Custom query
		calibratorSql: '', // Custom query
		validatorSql: '', // Custom query
	},
	storage: {
		method: adapter.storage,
		config: config,
		sql: '', // Custom query
	},
}

Provide a custom SQL query with auth.sql. In this query all values from req.auth will be replaced. By default these are:

  • :header: full authorization header
  • :token: token from authorization header (requires auth.byToken = true)
  • :udid: unique device ID (ConCaVa v0.5+)

License

This software is licensed under the MIT license.

© 2016 Kukua BV

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago