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

Changes for migration to be postgres to be merged to main #86

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

jaanbaaz
Copy link
Collaborator

No description provided.

@jaanbaaz jaanbaaz requested a review from karntrehan November 14, 2024 07:27
@@ -28,12 +28,12 @@ def __init__(self, bot) -> None:
@commands.Cog.listener()
async def on_message(self, message):
pass
# contributor = SupabaseClient().read(
# contributor = PostgresClient().read(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets delete the commented code.

cogs/badges.py Outdated
@@ -143,7 +143,7 @@ def get_user_badges(self, discord_id):
):
userBadges["achievements"].append(self.discordXGithubBadge)

discordMemberData = SupabaseClient().read(
discordMemberData = PostgresClient().read(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create 1 class level instance of postgresclient please? Creating a new one each time seems unncessary.

cogs/badges.py Outdated
table="connected_prs", query_key="raised_by", query_value=github_id
),
"merged": SupabaseClient(table="connected_prs").read(
"merged": PostgresClient(table="connected_prs").read(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a different syntax. We should have a uniform syntax across the board.

@@ -13,27 +13,27 @@ def __init__(self, bot) -> None:
async def on_guild_role_create(self, role: discord.Role):
if role.name.startswith("College:"):
orgName = role.name[len("College: ") :]
SupabaseClient().addChapter(roleId=role.id, orgName=orgName, type="COLLEGE")
PostgresClient().addChapter(roleId=role.id, orgName=orgName, type="COLLEGE")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class level instance here as well. Lets do it for all classes.

# async def give_badges(self, ctx):
# self.give_discord_badges.start()

@tasks.loop(minutes=10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a duplicate? Merging issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants