![]() ![]() Mac OS seems to ship with SQLite libraries that do not have support for loading extensions compiled in, so this won't work "out of the box." Accordingly, snapshots won't work. Point to these module files in your profile config as shown in the example above. You can also compile them yourself if you want. Precompiled binaries are available for download from the SQLean github repository page. It's recommended that you install all the SQLean modules, as they provide many common SQL functions missing from SQLite. Given how SQLite aggressively ( the database anyway, it's probably not worth the effort.įor snapshots to work, you'll need the crypto module from SQLean to get an md5() function. These limitations make it really difficult to make the backup-and-swap-in functionality work properly. CASCADE or ALTER VIEW or provide information about relation dependencies in something information_schema-like. This choice was made because SQLite doesn't support DROP. Materializations are simplified: they drop and re-create the model, instead of doing the backup-and-swap-in new model that the other dbt database adapters support. You must set materialized='table' in models that reference other schemas. You'll get this error from SQLite: "view cannot reference objects in database ". database file) to reference objects in another schema. SQLite does not allow views in one schema (i.e. Schema names are stored in view definitions, so when you access a non-'main' database file outside dbt, you'll need to attach it using the same name, or the views won't work. Dropping a schema results in dropping all its relations and detaching the database file from the session. If dbt needs to create a new schema, it will be created in schema_directory as schema_name.db. Get attached when database connection is created. SQLite automatically assigns 'main' to the file you initially connect to, so this must be defined in your profile. (SQLite conflates databases and schemas.) ![]() Schemas are implemented as attached database files. crypto.so is needed for snapshots to work see SQLlite Extensions below. List of file paths of SQLite extensions to load. This can overlap with the dirs of files in schemas_and_paths as long as there's no conflicts. in most cases, this should be main.Ĭonnect schemas to paths: at least one of these must be 'main'ĭirectory where all *.db files are attached as schema, using base filename as schema name, and where new schemas are created. Value of 'schema' must be defined in schema_paths below. It still needs to be set in the configuration and is used by dbt internally. Required but the value is arbitrary because there is no 'database' portion of relation names in SQLite so it gets stripped from the output of ref() and from SQL everywhere. SQLite locks the whole db on writes so anything > 1 won't help. SQLite targets should be set up using the following configuration in your profiles.yml file.ĭescription of SQLite Profile Fields Field
0 Comments
Leave a Reply. |