Skip to content

Add database support with fluent query builder - #4

Merged
kacy merged 2 commits into
masterfrom
feature/database-support
Jan 29, 2026
Merged

Add database support with fluent query builder#4
kacy merged 2 commits into
masterfrom
feature/database-support

Conversation

@kacy

@kacy kacy commented Jan 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements PostgREST database operations (CRUD) in the previously empty src/db.rs file
  • Adds a fluent QueryBuilder API for constructing and executing database queries
  • Exports the db module publicly and adds from() method to Supabase struct

Features

  • CRUD Operations: select, insert, update, delete
  • Filter Methods: eq, neq, gt, gte, lt, lte, like, ilike, in_, is_null, not_null
  • Query Modifiers: order, limit, offset
  • Fluent API: Chain methods for readable query construction

Usage Examples

// Select with filters
client.from("users")
    .select("id,name,email")
    .eq("status", "active")
    .order("created_at.desc")
    .limit(10)
    .execute()
    .await?;

// Insert
client.from("users").insert(&user_data).execute().await?;

// Update
client.from("users").update(&updates).eq("id", "123").execute().await?;

// Delete
client.from("users").delete().eq("id", "123").execute().await?;

kacy and others added 2 commits January 28, 2026 20:17
Implement PostgREST database operations (CRUD) with an ergonomic builder pattern API:
- QueryBuilder struct for constructing and executing queries
- Filter methods: eq, neq, gt, gte, lt, lte, like, ilike, in_, is_null, not_null
- Query modifiers: order, limit, offset
- CRUD operations: select, insert, update, delete
- Comprehensive test suite with 9 tests

Usage:
  client.from("users").select("*").eq("status", "active").execute().await?;
  client.from("users").insert(&data).execute().await?;
  client.from("users").update(&data).eq("id", "123").execute().await?;
  client.from("users").delete().eq("id", "123").execute().await?;

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Auth tests now skip gracefully when network is unavailable or credentials
are missing, instead of panicking. This allows CI to pass without requiring
a real Supabase instance to be accessible.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kacy
kacy merged commit cdaa927 into master Jan 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant