惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
D
Docker
J
Java Code Geeks
腾讯CDC
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
M
MIT News - Artificial intelligence
L
LangChain Blog
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
博客园 - Franky
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
N
Netflix TechBlog - Medium
B
Blog RSS Feed
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
SQLite Database & Expo SQLite A much easy to use docs.
Deepak Sen ( · 2026-04-25 · via DEV Community

Deepak Sen (Web Developer)

Introduction to SQLite Database

An sqlite database is c lang. lib.implements Small Fast+Self contained+High reliability. Sql Db engine
It is most uses database in World
SQLite Built into the Mobiles,computer devices bundled inside
countless other application people uses every day.

The Latest Version of this Version 3.53.0
check version
sqlite3 --version

Uses as A:-

the primary engine for high-performance, persistent local data storage
It is essential for applications that require complex data relationships, offline-first functionality, or the management of large datasets that exceed the capabilities of simple key-value stores like AsyncStorage

What are the roles of sqlite in The react native or applications ?

  • Offline-First Data Management
  • Relational Data integrity
  • High-Performance Querying
  • API Caching

Popular SQLite Libraries for React Native
Choosing the right library depends on your environment (Expo vs. Bare React Native):

  • Expo SQLite: The standard for Expo projects. It provides a modern API with support for React Hooks, SQLiteProvider, and React Suspense for smooth data loading.

React native SQLite is best for both devices iOS and Android

  • react-native-sqlite-storage: A long-standing, battle-tested library for "bare" React Native projects, supporting both Android and iOS with an identical API.

  • Nitro SQLite (formerly Quick-SQLite): A high-performance alternative using JSI (JavaScript Interface) to communicate directly with C++, bypassing the standard React Native Bridge for significantly faster operations.

  • op-sqlite: Focuses on speed and low-level control, allowing for custom compilation flags and better performance for massive datasets.

Introduction
Expo SQlite is best for easily use sql offline store functionality in Expo React Native

What are the functions in Expo SQlite
openDatabaseAsync

  • where we define our database
  • import * as SQLite from 'expo-sqlite'
  • make a instance in db variable We need this function for init our db

execAsync

  • where we execute the initials and Queries to our database
  • parameter is that Query SQL

getAllAsync

  • this function for SELECT Query
  • it returns the SQL [] array for as a Data

runAsync

  • It we can manipulate datas Interting data

Step1
Initial Code

import * as SQLite from 'expo-sqlite';

const db = SQLite.openDatabaseSync('products.db');

export const initDB = async () => {
  await db.execAsync(`
    CREATE TABLE IF NOT EXISTS products (
      id INTEGER PRIMARY KEY AUTOINCREMENT,
      name TEXT,
      price REAL
    );
  `);
};

export default db;

Enter fullscreen mode Exit fullscreen mode

step 2

const [products, setProducts] = useState([]);

const getAllproducts=async()=>{
 const result = await db.getAllAsync("SELECT * FROM products");
 setProducts(result);
}
const addProduct =async(name,price)=>{  
    if(!name || !price){
        Alert.alert("Please enter all the fields");
        return;
    }
    await db.runAsync("INSERT INTO products (name, price) VALUES (?, ?)", [name, price]);
    Alert.alert('Success','Product added successfully')
    getAllproducts();
}

const deleteProduct =async(id)=>{
    await db.runAsync("DELETE FROM products WHERE id = ?", [id]);
    getAllproducts();
}

const editProduct =async(id,name,price)=>{
    await db.runAsync("UPDATE products SET name = ?, price = ? WHERE id = ?", [name, price, id]);
    getAllproducts();
}

Enter fullscreen mode Exit fullscreen mode