EinhugurDuckDB.Appender Class (console safe)
A class for large bulk appends.
The makers of DuckDB recommend using the appender class for large amount of inserts.
Object
Appender
class EinhugurDuckDB.Appender
Constructors
Methods
Examples
var db as EinhugurDuckDB.Database = EinhugurDuckDB.Database.CreateInMemory()
var connection as EinhugurDuckDB.Connection = db.Connect()
connection.SQLExecute("CREATE TABLE tblSomeData(Name String, Number Integer)")
if connection.Error then
MessageBox(connection.ErrorMessage)
end if
Dim a as EinhugurDuckDB.Appender = connection.CreateAppender("tblSomeData")
if not connection.Error then
for i as Integer = 1 to 100
a.BeginRow()
a.AppendString("Some name " + i.ToString())
a.AppendInt32(i)
a.EndRow()
next
a.Close()
var records as EinhugurDuckDB.Recordset = connection.SQLSelect("SELECT Count(*) FROM tblSomeData")
if connection.Error then
MessageBox connection.ErrorMessage
return
end if
MessageBox records.Int64Value(0,0).ToString() + " rows successfully appended"
else
MessageBox connection.ErrorMessage()
end if
Supported Platforms:
macOS Intel 32 bitmacOS Intel 64 bitmacOS Apple SiliconWindows 32 bitWindows 64 bitWindows ARM 64 bitLinux 32 bitLinux 64 bitLinux ARM 32 bit