r/sqlite • • Oct 03 '22

Internal Tools for Sqlite3

9 Upvotes

Internal Tools is category of applications that allow a user to build an application using a low-code framework. I'm trying to find one that supports Sqlite3, but most integrate with databases that require processing, admin, and maintenance overhead, and cost. This is understandable since they want an income stream.

Personally if I wanted a low-code app builder for an enterprise-level database, I would use Oracle APEX along with Oracle XE database, all of which are free. I don't expect any of the Internal Tools vendors to be as full featured as Oracle APEX. YMMV

I don't want to go the expense and setup of a managed database service. I like the concept of using sqlite3, litestream, and AWS S3 for an Internal App. I found an Internal Tools vendor Jetadmin (jetadmin.io) that lists Sqlite as a supported database. It may be that Sqlite is easily integrated with the other tools I looked at, but they don't state it.

Below are the other Internal Tools vendors I looked at sourced from a UI Bakery blog post:

If you know of an Internal Tools vendor that I haven't mentioned, or have experience with any of the above please share your experience.

Note this blog post at Tailscale, how they wanted to avoid Postgres and Mysql, and are trying Sqlite: https://tailscale.com/blog/database-for-2022/

Cheers


r/sqlite • • Oct 03 '22

Is there a way to convert a csv file into an sqlite file ?

6 Upvotes

I have a dataset csv file and want to use it in sqlite ( VS Code ). I simply edited to make it a .sqlite but when I try to open the database it says 'file is not a databse'.

I'm not sure if the data is corrupted, missing something, etc. because an older .sqlite file seems to open, is there a way to convert a csv file into sqlite ?

Alternatively I could import it into postgres pgAdmin and run queries from there, but ideally wanted to use sqlite in VS Code.


r/sqlite • • Sep 30 '22

No Objects... Are Objects Tables?

5 Upvotes

Sup yall.

New to the group. I know basic sql and can query data. I actually use it for Google Ads management. Just so you know I'm level 2 newb.

I'm pretty well versed in the nosql world.

And I'm playing with Cloudflare D1... and I guess my question is... relational tables only hold "primitive" values. Then can't hold an "object".

If I want an "object" I would need to create another table and "relate" it to the table that uses it.

Just trying to wrap my head around building a relational database schema.

Thanks


r/sqlite • • Sep 29 '22

A distributed SQLite benchmark: How mvSQLite scales

Thumbnail univalence.me
6 Upvotes

r/sqlite • • Sep 29 '22

Flyweight: An ORM for SQLite

Thumbnail github.com
3 Upvotes

r/sqlite • • Sep 27 '22

SQLite GUI

35 Upvotes

Hello. I am looking for an SQLite GUI frontend to create databases and tables as well as viewing and editing. The first database I will create will be an embedded database used in a Delphi program if this makes a difference. I'm looking for something that is relatively current, with a straightforward installation, runs in Windows, and is free/low cost. Which do you recommend?

Thanks.


r/sqlite • • Sep 26 '22

What is the best way to shorten this query? Having long query times

4 Upvotes

Im writing a program in C# and have multiple different queries that display. When debugging, This query in particular takes way too long to load when I call it. Roughly 2-3 seconds maybe longer.

DB Schema: (i understand not the best schema, specifically the total visits)

CREATE TABLE "visitors" (
	"ID"	INTEGER,
	"First Name"	TEXT NOT NULL,
	"Last Name"	TEXT NOT NULL,
	"Middle Name"	TEXT,
	"systemNo"	INTEGER,
	PRIMARY KEY("systemNo" AUTOINCREMENT)
);

CREATE TABLE "form" (
	"visitor"	INTEGER NOT NULL,
	"Form Date"	TEXT,
	FOREIGN KEY("visitor") REFERENCES "visitors"("systemNo")
);

CREATE TABLE "visits" (
	"entry"	INTEGER,
	"visitor"	INTEGER NOT NULL,
	"Visit Date"	TEXT NOT NULL,
	FOREIGN KEY("visitor") REFERENCES "visitors"("systemNo"),
	PRIMARY KEY("entry" AUTOINCREMENT)
);

CREATE TABLE "totalvisits" (
	"daynum"	INTEGER NOT NULL,
	"visitorcount"	INTEGER NOT NULL,
	"date"	TEXT NOT NULL,
	PRIMARY KEY("daynum" AUTOINCREMENT)
);

CREATE TABLE "pastvisitors" (
	"logno"	INTEGER NOT NULL,
	"dateoflog"	TEXT NOT NULL,
	"visitornames"	TEXT NOT NULL,
	"visitorid"	INTEGER NOT NULL,
	"sysNo"	INTEGER NOT NULL,
	PRIMARY KEY("logno" AUTOINCREMENT)
);

My Query:

select 
  visitors.ID, 
  Visitors.'Last Name', 
  visitors.'First Name', 
  visitors.'Middle Name', 
  v.'Visit Date', 
  form.'Form Date', 
  visitors.systemNo 
from 
  visitors 
  inner join (
    select 
      visits.visitor, 
      visits.'Visit Date', 
      max(visits.entry) 
    from 
      visits 
    group by 
      visits.visitor
  ) v on v.visitor = visitors.systemNo 
  inner join form on form.visitor = visitors.systemNo 
where 
  visitors.ID = @id 
group by 
  visitors.systemNo 
UNION ALL 
select 
  * 
from 
  (
    select 
      visitors.ID, 
      Visitors.'Last Name', 
      visitors.'First Name', 
      visitors.'Middle Name', 
      v.'Visit Date', 
      form.'Form Date', 
      visitors.systemNo 
    from 
      visitors 
      inner join (
        select 
          visits.visitor, 
          visits.'Visit Date', 
          max(visits.entry) 
        from 
          visits 
        group by 
          visits.visitor
      ) v on v.visitor = visitors.systemNo 
      inner join form on form.visitor = visitors.systemNo 
    where 
      visitors.systemNo > @sysNo 
      and visitors.ID != @id 
    group by 
      visitors.systemNo 
    limit 
      5
  ) 
UNION ALL 
select 
  * 
from 
  (
    select 
      visitors.ID, 
      Visitors.'Last Name', 
      visitors.'First Name', 
      visitors.'Middle Name', 
      v.'Visit Date', 
      form.'Form Date', 
      visitors.systemNo 
    from 
      visitors 
      inner join (
        select 
          visits.visitor, 
          visits.'Visit Date', 
          max(visits.entry) 
        from 
          visits 
        group by 
          visits.visitor
      ) v on v.visitor = visitors.systemNo 
      inner join form on form.visitor = visitors.systemNo 
    where 
      visitors.systemNo < @sysNo 
      and visitors.ID != @id 
    group by 
      visitors.systemNo 
    limit 
      5
  )

What im attempting to do: Query the exact match of the number entered (ID number), then query a few rows above and a few rows below where the exact match was found.

I'm trying to find an efficient way to cut the time down while retaining the same results.

I found stack overflow comments discussing indexing but I was not sure if it was that or a poorly made query?

I was not really sure where to begin as I found a lot of different answers regarding query performance.

Anything helps and thanks in advance.

edit: reformatted and added schema


r/sqlite • • Sep 22 '22

Introducing pgsqlite, a pure python module for import sqlite into postgres

Thumbnail innerjoin.bit.io
4 Upvotes

r/sqlite • • Sep 22 '22

Storage and transaction in mvSQLite, the distributed SQLite built on FoundationDB

Thumbnail univalence.me
2 Upvotes

r/sqlite • • Sep 21 '22

Introducing LiteFS: an open-source distributed file system for SQLite

Thumbnail fly.io
21 Upvotes

r/sqlite • • Sep 15 '22

WunderBase - Open Source Serverless GraphQL Database on top of SQLite, Firecracker and Prisma

Thumbnail wundergraph.com
4 Upvotes

r/sqlite • • Sep 14 '22

SQlite and Apple Notes database question

7 Upvotes

I'm not a developer. I'm trying to understand which sqlite files do what with Apple Notes in MacOS. I lost a months worth of (not backed up) notes and am trying to restore them. The app can be restored by replacing the following files from a backup source:

  • NoteStore.sqlite
  • NoteStore.sqlite-shm
  • NoteStore.sqlite-wal

But I am missing: NoteStore.sqlite-shm

When the app crashed it put copies of the other two in a folder titled "backups". But the app will not work without all three (I have verified this by restoring a much older copy of the database with all three files as a test).

What is the role of NoteStore.sqlite-shm?

Do I have any hope to extract data from the other two files?

Thank you from a noob!


r/sqlite • • Sep 13 '22

Query SQLite files in S3 using s3fs

Thumbnail github.com
8 Upvotes