mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 06:06:01 +00:00
json lines reader, writer
This commit is contained in:
@@ -11,6 +11,11 @@ async function run() {
|
||||
sheetName: 'Events',
|
||||
});
|
||||
|
||||
const jsonReader = await dbgateApi.jsonLinesReader({
|
||||
fileName: 'test.jsonl',
|
||||
header: false,
|
||||
});
|
||||
|
||||
const tableWriter = await dbgateApi.tableWriter({
|
||||
connection: {
|
||||
server: 'localhost',
|
||||
@@ -20,7 +25,7 @@ async function run() {
|
||||
database: 'Chinook',
|
||||
},
|
||||
schemaName: 'dbo',
|
||||
pureName: 'Events',
|
||||
pureName: 'Genre3',
|
||||
createIfNotExists: true,
|
||||
truncate: true,
|
||||
});
|
||||
@@ -40,7 +45,7 @@ async function run() {
|
||||
const consoleWriter = await dbgateApi.consoleObjectWriter();
|
||||
|
||||
// await dbgateApi.copyStream(excelReader, consoleWriter);
|
||||
await dbgateApi.copyStream(excelReader, tableWriter);
|
||||
await dbgateApi.copyStream(jsonReader, tableWriter);
|
||||
// await dbgateApi.copyStream(csvReader, consoleWriter);
|
||||
// await dbgateApi.copyStream(csvReader, tableWriter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user