Lotus - Lightweight, SQL query runner and storage for Phoenix apps

Yeah Blazer is amazing and I felt we were missing this in the Elixir/Phoenix ecosystem.

Looking forward to your feedback

1 Like

New Lotus Web 0.4.1 and Lotus 0.9.0 release:

Added a handful of features to this one and retouches the UI for a better look an experience:

1) Dynamic Variable Options Configuration:

There is a new dropdown options modal to configure options for the variable dropdown widget. You can add custom lists of static options or define a SQL query that returns a value or a pair of value,label to dynamically populate the options of the dropdown widget.

2) Multi-Database Schema Support:

For Postgres databases, you can now select which schemas you want to query. By default, it will execute against the public schema if none is selected. If you select one or more schemas, they will be added to the the query’s search_path.

3) Context-aware Schema Editor Completions:

We know have some context-awareness in the editor so we can better suggest columns that are relevant for the query you are writing. Instead of keywords, you will now see table names are columns suggested at the top.

4) Enhanced Query Result UI:

Lotus Web now shows a success label when a query is run and includes the total number of rows in the result and the execution time in milliseconds.

5) Other UI/UX Improvements

  • Theme switcher (Light/Dark/System)
  • Copy to clipboard button (whatever you have in the editor)
  • Editor and global keyboard shortcuts

While LotusWeb already has a solid feature set and its API surface is stabilizing, it’s still evolving. LotusWeb is generally safe to use in production. It relies on Lotus’s read-only execution and session safety.

However, if your application uses UUIDs or mixed ID formats, there are current limitations that affect how variables work in the LotusWeb UI:

  • Variable binding around UUID columns is constrained across different storage types and databases:

    • PostgreSQL uuid

    • MySQL BINARY(16) vs CHAR(36|32)

    • SQLite TEXT vs BLOB

  • You can still get a lot of value from the UI, but filtering on UUID columns with {{var}} will likely not work in Postgres as it warrants a special binary format that is not UI friendly (we convert to String for the UI but currently have no way to cast it back with runtime column inference).

Any feedback on bugs or limitation you find is welcome!

3 Likes

Almost forgot a big one: You can now export results to CSV too :tada:

10 Likes

New package website with demo you can play with:

6 Likes

Update: Major Feature Releases

Hi everyone! It’s been a few months since I introduced Lotus, and I wanted to share some exciting updates. We’ve shipped several major features

1) Query Result Visualizations

You can now visualize query results directly in Lotus with 5 chart types (Bar, Line, Area, Scatter, Pie). The implementation uses Vega-Lite for declarative charting with full dark mode support. Keyboard shortcuts make it fast to toggle between table and chart views (Cmd/Ctrl+1 for table, Cmd/Ctrl+2 for chart).

2) Production-Ready Caching System

We’ve added a comprehensive caching layer with two adapters:

  • ETS backend for single-node deployments (ships with sensible defaults)
  • Cachex adapter for distributed caching across clusters

The cache system includes tag-based invalidation, configurable TTL profiles (:results, :schema, :options), and modes like :bypass and :refresh. Schema introspection is now cached, eliminating expensive repeated lookups. It runs as an OTP application in your supervision tree.

3) Export System

Memory-efficient streaming exports. The CSV export uses chunked streaming to handle large result sets without loading everything into memory.

4) Column-Level Visibility Controls

You can now define fine-grained security policies at the column level with four visibility rules: :allow, :omit, :mask, and :error. This is helpful when you want to expose certain tables but hide sensitive columns like password_hash or mask PII.

5) Internationalization (i18n) Support

Lotus now ships with built-in internationalization using Gettext. The UI includes comprehensive English and French translations out of the box. The locale system integrates seamlessly with Phoenix sessions - just set :lotus_locale in your session (e.g., from a user preference) and Lotus automatically switches the interface language during LiveView mount. All UI strings are maintained in the library itself (priv/gettext//LC_MESSAGES/), so translations stay consistent across all Lotus installations. If you need additional locales or want to improve existing translations, contributions are welcome via PR - the goal is to have vetted translations that benefit the entire community.

All of these features maintain Lotus’s core philosophy: lightweight, embedded in your Phoenix app, with security as a first-class concern.

Would love to hear your feedback if you try any of these features!

5 Likes

Is anyone using Lotus on a regular basis? I’m interested in finding out if there are any pain points you’ve come across or what features are missing or where do you think Lotus roadmap should go.

7 Likes

Will it support Oracle?

As for Roadmap based on my usage it reminds me of Oracle Apex especially no effort to let normal users view and query data plus visualize or export it.

https://www.oracle.com/apex/

1 Like

I’d like to support more datasources, following in the direction of the the Blazer ruby gem does GitHub - ankane/blazer: Business intelligence made simple , but I need to focus on adding features and only had additional datasources if folks are actually using those.

2 Likes

I was actually thinking of using it for an internal system, tho we are just beginning the gathering of the requirements so it’ll probably be a little bit, sorry I can’t give you any feedback rn :man_bowing:

1 Like

Lotus 0.11.0 & LotusWeb 0.10.1 - Dashboards are here!

Excited to share the latest Lotus release: Dashboards - combine multiple queries into interactive, shareable views.

Dashboard Features:

  • 12-column grid layout - Arrange cards (queries, text, headings, links)
  • Public sharing - Generate secure tokens to share dashboards with external stakeholders (no login required)
  • Parallel execution - All query cards run concurrently with configurable timeouts

Automatic Type Casting System:

This release also introduces intelligent type casting for query variables. Lotus now automatically detects column types from your database schema and casts variable values accordingly:

  • PostgreSQL enums with pass-through handling
  • Composite types with JSON input support
  • Time values with ISO8601 parsing
  • Graceful fallback when schema info is unavailable

The system uses a new Lotus.Storage.TypeHandler behaviour, so you can implement custom handlers for your own database types.

Try the demo: Lotus Dashboard

Upgrade with:
{:lotus, “~> 0.11.0”},
{:lotus_web, “~> 0.10.0”}

Feedback and questions welcome!

8 Likes

How I can utilize it to send alerts or notifications when certain conditions are met in the result of the query? Also can I ask to refresh the web query result on periodic basis “serves some data monitoring needs”?

1 Like

I haven’t implement that feature yet. Can you elaborate how you would set those conditions and to which destinations you’d want to send alerts to?

I have found LLMs to actually be relatively decent at quickly slopping up complex queries, provided it is aware of the schema. Would be great to have a button that copied a table’s create statement to clipboard (or some similar schema definition) that could be easily pasted into a chat to give it better context.

Or even more interesting, have an opt-in feature where an AI API key could be added to the configuration (or an oauth flow - whatever makes sense), and have an integrated chat for the query builder that only had access to the query, schema, and query errors for debugging.

1 Like

I have some legacy applications that we would like to monitor some criteria in it like if a certain number of transactions rejected in a sliding time window compare it with some threshold and based on it send some defined alert to telegram and stream alerting UI.

Another one for silence detection which is if no entries or low entries within a sliding windows again alert about service down.

Finally , monitor for certain rejection reasons and if number threshold met send an alert.

2 Likes

Having a BYOK (bring your own key) AI feature for building queries in natural language is something that’s in the roadmap :slight_smile:

2 Likes

Lotus v0.12 / LotusWeb v.11 adds AI-powered query generation :robot:

Generate SQL from natural language, right inside LotusWeb.

How it works:

  • Type what you want: “Show customers with overdue invoices”
  • AI explores your schema and generates the SQL
  • Review, refine, and run

Key details:

  • BYOK (Bring Your Own Key) - works with OpenAI, Anthropic, or Google Gemini
  • Schema-aware - the AI sees your tables, columns, and even checks actual enum values
  • Secure - respects Lotus visibility rules (AI only sees what you see)
  • Keyboard shortcut: Cmd/Ctrl+K to open

The AI Assistant is experimental and optional. Perfect for:

  • Exploring unfamiliar schemas
  • Writing complex JOINs faster
  • Getting unstuck on tricky queries
4 Likes

Fantastic start! I gave it a try on a complex query, which resulted in a query error. It doesn’t seem to be conversational, so I’m unclear on the best way to interact. Some ideas:

  • It could automatically detect error results and feed that back into the context and try again, sort of agent style.
  • Every “generate” could be a new entry in a conversation that stays in the context, along with the previously generated query. (Could have a “Clear”/“Reset” button to start an entirely new query.)
2 Likes

Do you know what the LLM got wrong about the query? Was it missing context?

1 Like

It had all the context it needed, it was just a query that dealt with JSON aggregate type stuff. I’ve always had to go back and forth when working with an LLM in a chat to get it right on previous occasions, even when it has all the schema info. I don’t think it’s reasonable to expect it to succeed with a one-shot for this sort of thing, so I’m looking more for the ability to have some kind of feedback loop for refining the result.

2 Likes

I’ve got a working prototype locally.

3 Likes