Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RavelCAPI
2 changes: 2 additions & 0 deletions engine/CSVParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ bool DataSpec::processChunk(std::istream& input, const TokenizerFunction& tf, si
if (starts.size()-1 < firstEmpty && starts.back()<nCols && emptyTail(line, starts.back()))
firstEmpty=starts.size()-1;
}
if (starts.empty())
throw runtime_error("CSV file is empty");
// compute average of starts, then look for first row that drops below average
double sum=0;
for (unsigned long i=0; i<starts.size(); ++i)
Expand Down
1 change: 1 addition & 0 deletions gui-js/libs/shared/src/lib/backend/minsky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,7 @@ export class ravelCAPI__Database extends CppClass {
constructor(prefix: string){
super(prefix);
}
async backends(): Promise<string[]> {return this.$callMethod('backends');}
async close(): Promise<void> {return this.$callMethod('close');}
async connect(a1: string,a2: string,a3: string): Promise<void> {return this.$callMethod('connect',a1,a2,a3);}
async connection(): Promise<object> {return this.$callMethod('connection');}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class ConnectDatabaseComponent implements OnInit {
connection: string;
table="";
tables=[];
backends=[];
ravel: Ravel;
constructor(
private route: ActivatedRoute,
Expand All @@ -33,9 +34,8 @@ export class ConnectDatabaseComponent implements OnInit {
this.ravel=new Ravel(this.electronService.minsky.canvas.item);
}

ngOnInit(): void {
this.route.queryParams.subscribe((params) => {
});
async ngOnInit() {
this.backends=await this.ravel.db.backends();
}

setDbType(event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<div class="container">
<div class="row">
<select (change)="setDbType($event)">
<option value="sqlite3" selected>SQLite</option>
<option value="postgresql">PostgresQL</option>
<option value="mysql4">MySQL/MariaDB</option>
<option value="odbc4">ODBC</option>
<option value="odbc4">ODBC</option>
<option value="oracle">Oracle</option>
<option value="db2">DB2</option>
<option value="firebird">Firebird</option>
<option *ngFor="let b of backends" [value]="b" [selected]="b==='sqlite3'">{{b}}</option>
</select>
<button [hidden]="dbType!=='sqlite3'" (click)="selectFile()">Select File</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export class NewDatabaseComponent implements OnInit {
connection: string;
table="";
tables=[];
backends=[];
constructor(
private route: ActivatedRoute,
private electronService: ElectronService,
private cdRef: ChangeDetectorRef
) {
}

ngOnInit(): void {
this.route.queryParams.subscribe((params) => {
});
async ngOnInit() {
this.backends=await this.electronService.minsky.databaseIngestor.db.backends();
}

setDbType(event) {
Expand Down
10 changes: 2 additions & 8 deletions gui-js/libs/ui-components/src/lib/new-database/new-database.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<div class="container">
<div class="row">
<select (change)="setDbType($event)">
<option value="sqlite3" selected>SQLite</option>
<option value="postgresql">PostgresQL</option>
<option value="mysql4">MySQL/MariaDB</option>
<option value="odbc4">ODBC</option>
<option value="odbc4">ODBC</option>
<option value="oracle">Oracle</option>
<option value="db2">DB2</option>
<option value="firebird">Firebird</option>
<option *ngFor="let b of backends" [value]="b"
[selected]="b==='sqlite3'">{{b}}</option>
</select>
<button [hidden]="dbType!=='sqlite3'" (click)="selectFile()">Select File</button>
</div>
Expand Down
Loading
Loading