ploomber.products.SQLiteRelation

class ploomber.products.SQLiteRelation(identifier, client=None)

A SQLite relation

Parameters:
  • identifier (tuple of length 3 or 2) – A tuple with (schema, name, kind) where kind must be either ‘table’ or ‘view’. If passed a tuple with length 2, schema is assumed None. Schemas in SQLite represent other databases when using the ATTACH command.

  • client (ploomber.clients.DBAPIClient or SQLAlchemyClient, optional) – The client used to connect to the database. Only required if no dag-level client has been declared using dag.clients[class]

Examples

>>> from ploomber.products import SQLiteRelation
>>> relation = SQLiteRelation(('schema', 'some_table', 'table'))
>>> str(relation) # returns qualified name
'schema.some_table'

Methods

delete()

Deletes the product

download()

exists()

This method returns True if the product exists, it is not part of the metadata, so there is no cached status

fetch_metadata()

render(params, **kwargs)

Render Product - this will render contents of Templates used as identifier for this Product, if a regular string was passed, this method has no effect

save_metadata(metadata)

to_json_serializable()

Returns a JSON serializable version of this product

upload()

delete()

Deletes the product

download()
exists()

This method returns True if the product exists, it is not part of the metadata, so there is no cached status

fetch_metadata()
render(params, **kwargs)

Render Product - this will render contents of Templates used as identifier for this Product, if a regular string was passed, this method has no effect

save_metadata(metadata)
to_json_serializable()

Returns a JSON serializable version of this product

upload()

Attributes

client

kind

name

Used as identifier in the database

schema

task