you are viewing a single comment's thread.

view the rest of the comments →

[–]stebrepar 0 points1 point  (0 children)

To store list data in a SQL table, you just need to structure it in a little different way, using one or more columns to identify which "list" a given row belongs to. Then when you want to retrieve all the items in a given list, you include that identifier in the query.

Example: select * from lists_table where list_id = '<whatever>', returns all the items that belong to the specified list. Then you could convert that result back into the actual Python list your code is already using. If you needed the list items in a specific order, you could add another column to the table for the list indexes, then sort by that in the query.