Add tables to Replit DB

Replit DB doesn’t have too many features, and It doesn’t even have tables! It would be cool to see them in Replit DB. yeah i can think of much to put here

5 Likes
  1. What language?
  2. What do you mean tables? Like Lua and TOML tables and Python dictionaries and JS objects? Or did you have something else in mind?
4 Likes

I think they meant more like multiple columns of values instead of only key-value.

4 Likes

I’d recommend using lists/dicts nested in lists/dicts, as a (potentially more dynamic) form of columns, which also supports up to infiinite dimensions

3 Likes

What does that mean? You can already have multiple key-value pairs

1 Like

I think they mean more like the below, though. Like a table you would have in SQL or something:

a b c
a1 b1 c1
a2 b2 c2
3 Likes

Yes, but key value pairs can only be accessed by their key, right? Well in tables with multiple columns kinda like in SQL you can get an item by any of the columns, which means you can lookup a user by their ID, username, amount of Repls, or anything you want. It’s way faster and easier to use than key-value pairs.

4 Likes

I interpreted what they meant as like Microsoft Access tables.

If they mean like tables like

Header 1 Header 2 Header 3
Content 1 Content 2 Content 3
Content 4 Content 5 Content 6

then they could use dictionaries/arrays and write a replit extension if they wanted to visualize it.

3 Likes

“Tables” in a “DB” usually refers to SQL tables or NoSQL tables.
Replit DB seems to be a NoSQL DB, and has NoSQL tables of Key:Value pairs, like a dictionary. (each created Replit DB can be seen as a unique NoSQL table.)

For SQL tables, Replit has SQL Lite : https://docs.replit.com/hosting/databases/sqlite-on-replit

2 Likes

I would like to point out that unless you are using replit DB, your database will be public in your repl.

2 Likes

I’m pretty sure you can encrypt sqlite databases with a key in your secrets.

sqlite would probably be a viable way to get a more advanced db in a repl, and wouldn’t theoretically take up any egress

4 Likes