Exploiting PostgreSQL's power with Elixir / Ecto applications
summary
Shows how to push access control into Postgres using database roles (e.g. chinook_admin, chinook_supervisor, chinook_agent, chinook_customer), a trigger that validates role strings (check_role_exists), and migrations that run SQL like CREATE POLICY and RLS rules expressing the supervisor/agent/customer row filters. Ecto code wraps queries in a Repo.transaction that runs SET LOCAL role and set_config('chinook.app_user', user_id) so application queries return only rows allowed by the DB policies; trade-offs: SQL skill and complex-policy planning.
AI-written summary · about
chapters (5)
- 0:00Start
- 4:10Authorisation System
- 5:56Chinook Database
- 17:23Let's use Postgres
- 20:57Row Level Security (RLS)
related talks
40mPostgreSQL Security for Application Developers
42mData Security using Roles, Privileges and Row Level Security
41mEmbrace the Database With Ecto
35mElixir's Ecto: Functional Relational Data Access Done Right
27mFor Your Eyes Only: Roles, Privileges, and Security in PostgreSQL
47mUntangling the Web of PostgreSQL Permissions
41mEcto: A language integrated query for Elixir
37mLeveling Up With Ecto
