How to use the mysql.getClassicSession function in mysql

To help you get started, we’ve selected a few mysql 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 mysql / mysql-shell / unittest / scripts / js_devapi / scripts / mysql_resultset.js View on Github external
// Assumptions: ensure_schema_does_not_exist
// Assumes __uripwd is defined as :@:
var mysql = require('mysql');

var mySession = mysql.getClassicSession(__uripwd);

mySession.runSql('drop schema if exists js_shell_test');
mySession.runSql('create schema js_shell_test');
mySession.runSql('use js_shell_test');

//@<> Result member validation
var result = mySession.runSql('create table js_shell_test.buffer_table (name varchar(50) primary key, age integer, gender varchar(20))');

validateMembers(result, [
'affectedItemsCount',
'executionTime',
'warningCount',
'warnings',
'warningsCount',
'getAffectedItemsCount',
'getExecutionTime',
github mysql / mysql-shell / unittest / scripts / js_devapi / scripts / mysql_module.js View on Github external
// __uri: @
// __host: 
// __port: 
// __user: 
// __uripwd: :@
// __pwd: 

//@<> mysql module: exports
validateMembers(mysql, [
    'getClassicSession',
    'getSession',
    'help'])

//@# getClassicSession errors
mysql.getClassicSession()
mysql.getClassicSession(1, 2, 3)
mysql.getClassicSession(["bla"])
mysql.getClassicSession("some@uri", 25)

//@# getSession errors
mysql.getSession()
mysql.getSession(1, 2, 3)
mysql.getSession(["bla"])
mysql.getSession("some@uri", 25)
github mysql / mysql-shell / unittest / scripts / js_devapi / scripts / mysql_schema.js View on Github external
// Assumptions: ensure_schema_does_not_exist available
// Assumes __uripwd is defined as :@:
var mysql = require('mysql');

var mySession = mysql.getClassicSession(__uripwd);

ensure_schema_does_not_exist(mySession, 'js_shell_test');

mySession.createSchema('js_shell_test');
mySession.setCurrentSchema('js_shell_test');

var result;
result = mySession.runSql('create table table1 (name varchar(50));');
result = mySession.runSql('create view view1 (my_name) as select name from table1;');

var schema = mySession.getSchema('js_shell_test');

// We need to know the lower_case_table_names option to
// properly handle the table shadowing unit tests
var lcresult = mySession.runSql('select @@lower_case_table_names')
var lcrow = lcresult.fetchOne();
github mysql / mysql-shell / unittest / scripts / js_devapi / scripts / mysql_module.js View on Github external
// __port: 
// __user: 
// __uripwd: :@
// __pwd: 

//@<> mysql module: exports
validateMembers(mysql, [
    'getClassicSession',
    'getSession',
    'help'])

//@# getClassicSession errors
mysql.getClassicSession()
mysql.getClassicSession(1, 2, 3)
mysql.getClassicSession(["bla"])
mysql.getClassicSession("some@uri", 25)

//@# getSession errors
mysql.getSession()
mysql.getSession(1, 2, 3)
mysql.getSession(["bla"])
mysql.getSession("some@uri", 25)
github mysql / mysql-shell / unittest / scripts / js_devapi / scripts / mysql_session.js View on Github external
// Assumptions: ensure_schema_does_not_exist is available
// Assumes __uripwd is defined as :@:
var mysql = require('mysql');

//@<> Session: validating members
var classicSession = mysql.getClassicSession(__uripwd);

validateMembers(classicSession, [
    'close',
    'commit',
    'getUri',
    'help',
    'isOpen',
    'startTransaction',
    'query',
    'rollback',
    'runSql',
    'uri'])

//@ ClassicSession: accessing Schemas
var schemas = classicSession.getSchemas();
github mysql / mysql-shell / unittest / scripts / js_devapi / setup / setup.js View on Github external
function check_super_read_only_done(connection) {
  ro_session = ro_module.getClassicSession(connection);
  wait(60, 1, wait_super_read_only_done);
  ro_session.close();
}
github mysql / mysql-shell / unittest / scripts / js_devapi / scripts / dba_super_read_only_handling.js View on Github external
function setupInstance(connection, super_read_only) {
    var tmpSession = mysql.getClassicSession(connection);

    tmpSession.runSql('SET GLOBAL super_read_only = 0');
    if (super_read_only) {
        tmpSession.runSql('set global super_read_only=ON');
    }

    tmpSession.close();
}
github mysql / mysql-shell / unittest / scripts / js_devapi / scripts / dba_super_read_only_handling.js View on Github external
function ensureSuperReadOnly(connection) {
    var tmpSession = mysql.getClassicSession(connection);
    tmpSession.runSql('set global super_read_only=ON');
    tmpSession.close();
}