Skip to content

Commit 2c3795c

Browse files
committed
Complete SQL Ball rebrand and fix all core components
🚀 REBRAND TO SQL BALL: - Update title from 'The Premier League Oracle' to 'SQL Ball' - Create custom football SVG logo to replace Vite logo - Update favicon and header with new football icon 🔧 FIX PATTERN DISCOVERY: - Update field mappings to use correct database schema - Replace 'finished' field with proper null checks - Change 'kickoff_time' to 'match_date' for queries - Enable pattern discovery to work with European league data ⚽ QUERY BUILDER IMPROVEMENTS: - Fix auto-execute toggle visual animation - Update all example queries to work with actual schema - Remove references to non-existent fields (home_xg, season_id) - Update schema documentation for accurate SQL generation ✅ SEASON & DATA FIXES: - Ensure 2024-2025 is recognized as current season (Sept 2025) - Verify chart data pulls from correct season - Confirm SeasonStats only shows 2024-2025 option - All components now working with European league data (7,681 matches)
1 parent 0c6cb01 commit 2c3795c

5 files changed

Lines changed: 56 additions & 21 deletions

File tree

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/football.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>The Premier League Oracle</title>
7+
<title>SQL Ball</title>
88
</head>
99
<body>
1010
<div id="app"></div>

public/football.svg

Lines changed: 32 additions & 0 deletions
Loading

src/components/Header.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
</button>
4444

4545
<div class="flex items-center gap-3">
46-
<div class="w-10 h-10 bg-gradient-to-br from-green-500 to-emerald-500 rounded-lg flex items-center justify-center">
47-
<span class="text-white font-bold text-lg">SB</span>
46+
<div class="w-10 h-10 rounded-lg flex items-center justify-center">
47+
<img src="/football.svg" alt="SQL Ball" class="w-8 h-8" />
4848
</div>
4949
<div>
5050
<h1 class="text-xl font-bold text-slate-900 dark:text-white">SQL-Ball</h1>

src/components/QueryBuilder.svelte

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
4040
// Natural language examples for the AI-powered query system
4141
const exampleQueries = [
42-
"Show me Liverpool's latest Premier League matches",
43-
"Find Real Madrid vs Barcelona matches this season",
44-
"Which Bundesliga teams score the most goals at home?",
45-
"Show me Serie A matches with more than 4 goals",
46-
"Compare PSG's home vs away record in Ligue 1",
47-
"Find matches with the most red cards across all leagues",
48-
"Show Arsenal's Champions League results this season",
49-
"Which teams in La Liga have the strongest defense?"
42+
"Show me Liverpool's latest matches this season",
43+
"Find matches between Real Madrid and Barcelona",
44+
"Which teams in the Premier League score the most goals at home?",
45+
"Show me matches with more than 4 total goals",
46+
"Find all Liverpool matches in 2024-2025 season",
47+
"Show matches with the most yellow cards",
48+
"Which teams have the best home record?",
49+
"Find high-scoring matches in La Liga this season"
5050
];
5151
5252
onMount(async () => {
@@ -143,10 +143,9 @@
143143
content: `You are an SQL expert for SQL-Ball, a football analytics platform. Convert natural language queries to PostgreSQL queries.
144144
145145
Database Schema:
146-
- seasons table: id, name (e.g., '2023-24', '2024-25')
147-
- matches table: id, season_id, match_date, home_team, away_team, home_score, away_score, home_xg, away_xg, home_shots, away_shots, result (H/A/D)
148-
- leagues table: id, league_name, country (e.g., 'Premier League', 'La Liga', 'Bundesliga')
149-
- teams table: id, team_name, league_id
146+
- matches table: id, match_date, home_team, away_team, home_score, away_score, result (H/A/D), div (league code like 'E0', 'SP1'), season ('2024-2025'), ht_home_score, ht_away_score, ht_result, referee, home_shots, away_shots, home_shots_target, away_shots_target, home_fouls, away_fouls, home_corners, away_corners, home_yellow_cards, away_yellow_cards, home_red_cards, away_red_cards
147+
148+
European league codes: E0=Premier League, SP1=La Liga, I1=Serie A, D1=Bundesliga, F1=Ligue 1, etc.
150149
151150
Rules:
152151
1. Return ONLY the SQL query, no explanations or markdown
@@ -423,7 +422,9 @@ Output: SELECT match_date, home_team, away_team, home_score, away_score FROM mat
423422
on:change={toggleAutoExecute}
424423
class="sr-only peer"
425424
/>
426-
<div class="w-11 h-6 bg-slate-200 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-green-300 dark:peer-focus:ring-green-800 rounded-full peer dark:bg-slate-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-green-600"></div>
425+
<div class="relative w-11 h-6 bg-slate-200 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-green-300 dark:peer-focus:ring-green-800 rounded-full peer dark:bg-slate-700 peer-checked:bg-green-600 transition-colors">
426+
<div class="absolute top-[2px] left-[2px] bg-white border border-gray-300 rounded-full h-5 w-5 transition-transform {autoExecute ? 'translate-x-full' : 'translate-x-0'} dark:border-gray-600"></div>
427+
</div>
427428
</label>
428429
<span class="text-sm text-slate-600 dark:text-slate-400">Auto-execute</span>
429430
</div>

src/lib/analytics/patternDiscovery.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ export class PatternDiscovery {
3030
const { data, error } = await supabase
3131
.from('matches')
3232
.select('*')
33-
.eq('finished', true)
33+
.not('home_score', 'is', null)
34+
.not('away_score', 'is', null)
3435
.gt('away_score', 0)
35-
.order('kickoff_time', { ascending: false })
36+
.order('match_date', { ascending: false })
3637
.limit(Math.min(limit * 3, 100));
3738

3839
if (error) throw error;
@@ -59,8 +60,9 @@ export class PatternDiscovery {
5960
const { data, error } = await supabase
6061
.from('matches')
6162
.select('*')
62-
.eq('finished', true)
63-
.order('kickoff_time', { ascending: false })
63+
.not('home_score', 'is', null)
64+
.not('away_score', 'is', null)
65+
.order('match_date', { ascending: false })
6466
.limit(200);
6567

6668
if (error) throw error;

0 commit comments

Comments
 (0)