GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • JavaQueryBuilder
  • Installation
  • Queries
  • SELECT
  • INSERT
  • UPDATE
  • DELETE
  • CREATE TABLE
  • Conditions
  • Subqueries
  • SQL Dialects
  • STANDARD
  • MySQL
  • SQLite

This view

  • Original page
  • New address

GeezerVison is showing ezframework.github.io — SQLite

SQLite Dialect

Table of contents

  1. Overview
  2. SELECT
  3. DELETE with LIMIT
  4. Identifier quoting coverage
  5. When to use

Overview

SqlDialect.SQLITE wraps all table and column identifiers in double-quotes ("), which is the SQL standard quoting character that SQLite follows. It also supports the LIMIT clause on DELETE statements.

Feature Value
Identifier quoting Double-quote "
DELETE LIMIT Supported
ILIKE Not supported
RETURNING on DELETE Not supported

SELECT

SqlResult r = new QueryBuilder()
    .from("users")
    .select("id", "name", "email")
    .whereEquals("status", "active")
    .orderBy("name", true)
    .buildSql(SqlDialect.SQLITE);
// → SELECT "id", "name", "email" FROM "users" WHERE "status" = ? ORDER BY "name" ASC
// Parameters: ["active"]

DELETE with LIMIT

Query q = new QueryBuilder()
    .from("cache")
    .whereLessThan("expires_at", "2025-01-01")
    .limit(500)
    .build();

SqlResult result = SqlDialect.SQLITE.renderDelete(q);
// → DELETE FROM "cache" WHERE "expires_at" < ? LIMIT 500
// Parameters: ["2025-01-01"]

Or via DeleteBuilder:

SqlResult result = QueryBuilder.deleteFrom("sessions")
    .whereEquals("expired", true)
    .build(SqlDialect.SQLITE);
// → DELETE FROM "sessions" WHERE "expired" = ?

Identifier quoting coverage

Double-quote quoting is applied by the dialect to identifiers in SELECT and DELETE statements. INSERT and UPDATE builders render their own SQL and do not apply dialect quoting to column or table names.


When to use

  • SQLite databases
  • Any SQL-standard database that uses double-quote identifiers
  • When DELETE … LIMIT batching is needed
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.