Refactor and remove sqlite and replace with MySQL

This commit is contained in:
2025-10-23 18:43:31 +01:00
parent d53e27eea8
commit 21ebc9c34b
139 changed files with 1013 additions and 529 deletions

View File

@@ -0,0 +1,21 @@
package storage
import (
"database/sql"
)
func AddMemberToSyndicate(db *sql.DB, syndicateID, userID int) error {
_, err := db.Exec(`
INSERT INTO syndicate_members (syndicate_id, user_id, joined_at)
VALUES (?, ?, CURRENT_TIMESTAMP)
`, syndicateID, userID)
return err
}
func InviteUserToSyndicate(db *sql.DB, syndicateID, invitedUserID, senderID int) error {
_, err := db.Exec(`
INSERT INTO syndicate_invites (syndicate_id, invited_user_id, sent_by_user_id)
VALUES (?, ?, ?)
`, syndicateID, invitedUserID, senderID)
return err
}