Main Content

DuckDB Native Interface

Interact with a DuckDB™ database using the DuckDB native interface

Create, connect, and interact with DuckDB database files. Perform data analysis and import data from the database into MATLAB®. Export data from MATLAB into the database. Explore and import data using the Database Explorer app or the command line.

Objects

connectionDuckDB native interface database connection (Since R2026a)

Functions

expand all

duckdbCreate DuckDB native interface database connection (Since R2026a)
closeClose database connection
isopenDetermine if database connection is open
databaseImportOptionsDefine import options for database data
getoptionsRetrieve import options for database data
previewPreview eight rows from database using import options
setoptionsCustomize import options for database data
resetReset to default import options for database data
fetchImport data from execution of SQL statement
sqlfindRetrieve metadata about database objects
sqlreadImport table data from database
sqlinnerjoinPerform inner join on two database tables
sqlouterjoinPerform outer join on two database tables
databaseDatastoreCreate datastore for data in database
hasdataDetermine if data in DatabaseDatastore is available to read
previewReturn subset of data from DatabaseDatastore
readRead data in DatabaseDatastore
readallRead all data in DatabaseDatastore
resetReset DatabaseDatastore to initial state
splitsqlquerySplit SQL query using paging
createConnectionForPoolInitialize parallel pool using database connection
sqlwriteInsert MATLAB data into database table
executeExecute SQL statement on database
commitMake changes to database permanent
rollbackRevert changes made to database
sqlupdateUpdate rows in database table (Since R2023a)

Topics