AshAge.Session (AshAge v1.0.1)

Copy Markdown View Source

Session setup for Apache AGE connections.

Configures each PostgreSQL connection with the correct search path and loads the AGE extension. This must be called on every new connection to ensure AGE functions and types are available.

Usage

Add to your Repo config:

config :my_app, MyApp.Repo,
  after_connect: {AshAge.Session, :setup, []}

This sets the search path to public, ag_catalog, "$user" and loads the AGE extension via LOAD 'age'.

Why the search path order matters

public must come before ag_catalog so that Ecto's public.schema_migrations table is found before AGE's ag_catalog.schema_migrations, which would otherwise shadow it and break Ecto migrations.

Summary

Functions

Sets up an AGE-ready session on the given database connection.

Functions

setup(conn)

@spec setup(DBConnection.t()) :: :ok

Sets up an AGE-ready session on the given database connection.

Called automatically by Ecto's after_connect hook. Sets the search path and loads the AGE extension.