-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery_agents.ts
More file actions
40 lines (31 loc) · 1.03 KB
/
query_agents.ts
File metadata and controls
40 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { createClient } from '@supabase/supabase-js'
const supabaseUrl = process.env.SUPABASE_URL
const supabaseKey = process.env.SUPABASE_KEY
if (!supabaseUrl || !supabaseKey) {
console.error('Missing SUPABASE_URL or SUPABASE_KEY')
process.exit(1)
}
const supabase = createClient(supabaseUrl, supabaseKey)
async function main() {
console.log('Querying agents...')
const { data: agents, error } = await supabase
.from('agents')
.select('*')
.ilike('name', '%Antigravity%')
if (error) {
console.error('Error querying agents:', error)
} else {
console.log('Agents found:', agents)
}
console.log('Querying devices...')
const { data: devices, error: devError } = await supabase
.from('devices')
.select('*')
.ilike('name', '%Laptop%') // Guessing column name
if (devError) {
console.error('Error querying devices:', devError)
} else {
console.log('Devices found:', devices)
}
}
main()