View Source Adbc.Database (adbc v0.1.0)

Documentation for Adbc.Database.

Databases are modelled as processes. They required a driver to be started.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts a database process.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Starts a database process.

Options

  • :driver (required) - the driver to use for this database. See Adbc module documentation for support drivers and information

  • :process_options - the options to be given to the underlying process. See GenServer.start_link/3 for all options

All other options are given as database options to the underlying driver.

Examples

Adbc.Database.start_link(
  driver: :sqlite,
  process_options: [name: MyApp.DB]
)

In your supervision tree it would be started like this:

children = [
  {Adbc.Database,
   driver: :sqlite,
   process_options: [name: MyApp.DB]},
]