r/sqlite • • 12d ago

How does a SQLite server work?

Hey guys, I'm new to SQL and all of the tech. I'm planning on using SQLite for a school project, cos I heard it's relatively simple and easy-to-use. However, before I install and mess around with it, I have some questions.

So, this project will act as an application on someone else's computer, and that's the part that confuses me. Because if I install SQLite on my computer, create a database using it and integrate said database into a Java application, will the database I created remain exclusive to my computer, or can I transfer it to another user's computer? (if that makes sense). Like, if I export this Java application onto another computer, what will happen to the database? Do I manually need to copy and config it for every computer my application is running on, or no, not really?

Sorry if this is a stupid question, I'm new to all of this so I really would appreciate someone clarifying this for me.

Thanks in advance!

6 Upvotes

17 comments sorted by

View all comments

1

u/rupertavery64 12d ago

It's just a file.

When you write a program that uses it, you will most likely import a library for sqlite. That library has methods to open the database file (if it doesn't exist yet, it will create it). There will be methods for creating the tables and columns if they don't exist yet, or ignore if they do.

Then you can query the database using SQL commands. There are some small differences between regular SQL and SQL for SQLite.

You can use https://sqlitebrowser.org/ to open a SQLite database directly.

Since it's just a .db file, you can just copy it. I assume you know about relative paths and making sure your application can see the database from it's current path.