A hello world implementation of a bulk loader into HelloDB.
Clone or download gotodb.go
.
The data file has to be delimited by a character not used by any of the field values. Furthermore, the field values have to be in the same order as defined in the HelloDB
metadata configuration file.
For example, data.txt
:
Joe|28|Boston
Bob|35|New York
|35|New York
Susan|35
Run the script with the appropriate command line arguments:
go run gotodb.go <table> <file> <delimeter> <server>
For example:
$ go run gotodb.go customers data.txt '|' localhost:27000
inserted>
recno: 1
inserted>
recno: 2
inserted>
recno: 3
inserted>
recno: 4