You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Desktop: Add support for OCR (#8975)
This commit is contained in:
17
packages/lib/services/database/sqlStringToLines.ts
Normal file
17
packages/lib/services/database/sqlStringToLines.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export default (sql: string) => {
|
||||
const output = [];
|
||||
const lines = sql.split('\n');
|
||||
let statement = '';
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (line === '') continue;
|
||||
if (line.substr(0, 2) === '--') continue;
|
||||
statement += line.trim();
|
||||
if (line[line.length - 1] === ',') statement += ' ';
|
||||
if (line[line.length - 1] === ';') {
|
||||
output.push(statement);
|
||||
statement = '';
|
||||
}
|
||||
}
|
||||
return output;
|
||||
};
|
Reference in New Issue
Block a user