Db client

From Yate Documentation
Revision as of 17:19, 25 February 2014 by Ximik777 (Talk | contribs)

Jump to: navigation, search

javascript.conf

[general]
scripts_dir=/your/dir/where/js/files/
....
[scripts]
init=init.js

If you use MySql edit mysqldb.conf

[general]
priority=100

[yate_my]
host=localhost
port=3306
database=database_name
user=database_user
password=yourpass123

If you use PostgreSql edit pgsqldb.conf

[general]
priority=100

[yate_pg]
host=localhost
port=5432
database=database_name
user=database_user
password=yourpass123


init.js

#require "db_client.class.js"
// db_client('use account name', 'database module, default pgsql');
var db = new db_client('yate_my', 'mysql');
or 
var db = new db_client('yate_pg', 'pgsql');
db.query('INSERT INTO extension (extension,password) VALUES ($,$)', ['100','100']);
Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers