1.0.8 • Published 5 years ago

@dvo/batch-query v1.0.8

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

@dvo/batch-query

This tool is meant to merge a mySQL query and a data array into a formatted query that does what it needs in batch. For example, the query

let query =
'REPLACE INTO common_surnames
  (america, spain, korea)
VALUES
  (?,?,Kim)'

could be combined with data like

let data = [
  ['Johnson', 'Gutierrez'],
  ['Lee', 'Pança'],  
  ['McDonald', 'Plata']
]

when called with batchQuery( query, data ) to produce the results

let formattedQuery =
'REPLACE INTO common_surnames
  (america, spain, korea)
VALUES
  (Johnson,Gutierrez,Kim),
  (Lee,Pança,Kim),
  (McDonald,Plata,Kim)'
1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago