Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SQLite and Data Migration Plan #7

Open
3 tasks
vo1dee opened this issue Nov 3, 2024 · 12 comments
Open
3 tasks

Implement SQLite and Data Migration Plan #7

vo1dee opened this issue Nov 3, 2024 · 12 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vo1dee
Copy link
Owner

vo1dee commented Nov 3, 2024

Overview

Create a basic SQLite database to store our data. SQLite is perfect for our needs because:

  • It's a single file (no server needed)
  • Built into Python
  • Easy to backup (just copy the file)

What We'll Do

  • Create a simple database structure

    -- Example of tables we'll create:
    Users
    - id
    - username
    - chat_id
    - email
    - location
    - created_at
    
    
    Game Stats
    - id
    - user_id
    - chat_id
    - game_id
    - word
    - created_at
  • Move current data

    • Copy existing data into new database
    • Double-check everything moved correctly
    • Keep backup of old data
  • Update code to use new database

    • Add SQLite connection
    • Update read/write operations
    • Test everything works

Why This Helps

  • Data will be properly organized
  • Easier to search and update
  • Less chance of data corruption
  • Better performance
@vo1dee vo1dee added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Nov 3, 2024
@Muneeba-Nazar
Copy link

I would like to help.

@vo1dee
Copy link
Owner Author

vo1dee commented Nov 3, 2024

I would like to help.

This is great. I appreciate the intention.
Anyhow, it's a personal pet project for personal use and education.
Help will be appreciated, but unfortunately not compensated financially.
If you still interested, let me know if you have any questions regarding the contribution @Muneeba-Nazar

@Muneeba-Nazar
Copy link

I would love to contribute, but you'll have to explain to me in detail what it is that you need to be done.

@vo1dee
Copy link
Owner Author

vo1dee commented Nov 3, 2024

I would love to contribute, but you'll have to explain to me in detail what it is that you need to be done.

Of course. Thank you so much.

I will be able to describe in details what's needs to be done in the morning, now I go to sleep and in the morning will describe needs more accurately

@vo1dee
Copy link
Owner Author

vo1dee commented Nov 4, 2024

Hello @Muneeba-Nazar,
So we currently have several user and bot data stored in data/ folder.

game_state.json --
stores words game data like chat_id and current word used in game.
{"-12345567": "example"}
need to be in separate table, also we can potentially add game state per chat and leaderboard

used_words.csv
list of used words, used while requesting new word via gpt to avoid repeated words.
currently just csv like "example1, example2, etc”

user_locations.csv

user location data,
we have a command /weather that takes a city as argument /weather New York,
however, if used once used command and provided location, location saved in CSV and following command will not require specifying location, and could be used by itself.
Current structure
user_id, location(city), times tempt to track last used location.

Let me know if you have any questions and need any help implementing this.

We also plan to expend functionality and maintain everything within DB will be more efficient.
If you have any ideas or advices they are very warm welcome

@Muneeba-Nazar
Copy link

Got it. I'm gonna start working on this, will let you know if i have any queries.

@vo1dee
Copy link
Owner Author

vo1dee commented Nov 7, 2024

Got it. I'm gonna start working on this, will let you know if i have any queries.

I highly appreciate

@Muneeba-Nazar
Copy link

is it possible that you give me the APIs needed to run the program??????

@vo1dee
Copy link
Owner Author

vo1dee commented Nov 8, 2024

Sure, can you DM me on telegram or discord?
https://t.me/vo1dee
discord: .vo1dee

@Muneeba-Nazar

@Muneeba-Nazar
Copy link

Muneeba-Nazar commented Nov 8, 2024

I'm unable to find you on discord. My discord is muniba_
Please dm me.

@vo1dee

This comment was marked as off-topic.

@Muneeba-Nazar

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants