batchTrackingTable
. The workflow consists of:* for each row, create a record in batchTrackingTable
with (originalId, newId, tbl) triplet set to the desired values
* The feature automatically builds the dependency graph for Primary and Foreign keys in the database and will update all the neccessary records automaticaly.
const sqlLib = require('izyware-sqlconsole-rekey').basePath;
const proxyLib = require('izy-proxy').basePath; ['chain.importProcessor',${sqlLib}/chain
, {
verbose: {
logConnectionAttempt: false,logQuery: false
}}],
[//inline/${proxyLib}/json?loadById
, { id:
{
"host":"example.org"}
}],chain => chain(['sql.connect', chain.get('outcome').data]),
['sql.query', 'select 1'] You can consult the nodejs mysql library for detailed options regarding connection pooling, clustering and SSL management. In addition to all the standard options the library supports custom adapters fot SOCKS5.[//inline/${proxyLib}/json?loadById
, { id:
"adapterservice":"//service/rel:adapter/socks5"
}}]
For embedded applications that require unusual networking environments, you may customize the adapter. Refer to the knowledge center on Izyware website for more details and white papers on this topic.
['sql.getInsert', {
table: 'table1',map: [
{ field1: 'value1', ... }]
]['sql.select', {
verbose: {logQuery: false
},map: {
jsonField1: 'table1.field1',owners: 'NOQUOTEGROUPCONCAT(DISTINCT CONCAT(accesscontrol.ownerType , "", accesscontrol.ownerId) SEPARATOR "sep")'
},// // useful for parsing joined groups, i.e owners above
deserializeGroupConcats: ['owners'],from: 'FROM table1 left join table2 ....',
condition: 'WHERE id = 1 limit 1 group by name'}]
/ returns JSON records /
['sql.query', 'string'],/ returns Array records /
['sql.query', { queryStr: 'select 1', recordFormat: 'array' }]For command line access use:
npm run query queryObject.dbConfigId xxxx-xxxx queryObject.sqlStr "SELECT 1"
npm run rekey queryObject.dbConfigId xxxx-xxxx queryObject.batchTrackingTable batchTrackingTableizywaresqldashboard_rekey queryObject.limit 20000 queryObject.batchSize 20 queryObject.schema dbname queryObject.tbl tablename queryObject.commit falsenpm run test
?
characters as placeholders for values you would like to have escaped.* encodeStringToSQLStrSingleQuoted
NOBACKSLASHESCAPES
mode is disabled (this is the default state for MySQL servers).* this will allow sharing a session across different chain within the current execusion context
* without this feature, all '//inline/' calls would have to explcitily pass in the sql session.* enables merging this with frame_getnode and replacing the legacy interface
* essential for mixed embedded app developmentsql.select
sql.getInsert
.github: https://github.com/izyware/apps-sqlconsole-rekey
npmjs: https://www.npmjs.com/package/izyware-sqlconsole-rekey