DEV Community

Alex Devson
Alex Devson

Posted on

The Laziest Way to Use SQLite in Android — EasiestSqlLibrary

I'm lazy. And I mean that in the best possible way — I hate writing boilerplate code. So when I needed SQLite in my Android app, I built the laziest SQL library possible.

The Problem

Android's default SQLite approach requires you to:

  1. Write a SQLiteOpenHelper subclass
  2. Define table creation SQL strings
  3. Write CRUD methods with ContentValues
  4. Handle cursors and close them properly
  5. Deal with database upgrades

That's way too much work for storing some data.

The Solution: EasiestSqlLibrary

// Initialize once
EasiestDB.init(this);

// Create a table with columns - that's it
EasiestDB.addTable("users", "name", "email", "age");

// Insert data
EasiestDB.addRow("users", "John", "john@email.com", "25");

// Read all data
List<EasiestDB.Row> rows = EasiestDB.getAllRows("users");
Enter fullscreen mode Exit fullscreen mode

No SQL strings. No ContentValues. No Cursors. No boilerplate.

Why 38+ Developers Starred This

  • 🚀 Zero boilerplate — create tables and CRUD in one line each
  • 📦 Lightweight — no heavy ORM overhead
  • 🧠 Intuitive API — if you can call a function, you can use this
  • 🔄 Auto-handles database creation, upgrades, and column management
  • Production tested — used in multiple published apps

Comparison

Task Standard SQLite EasiestSqlLibrary
Setup 50+ lines 1 line
Create table SQL string + helper 1 line
Insert row ContentValues + insert 1 line
Read data Cursor management 1 line

Get It

implementation 'p32929:EasiestSqlLibrary:1.0.+'
Enter fullscreen mode Exit fullscreen mode

👉 GitHub: https://github.com/p32929/EasiestSqlLibrary

Star it if you hate boilerplate too! ⭐


What's your preferred approach for local storage in Android? Room, Realm, or something else?

Top comments (0)