""" Check what a working GSC/G-Core mapping looks like in the database """ import asyncio import psycopg2 import json def check_mappings(): # Connect to PostgreSQL conn = psycopg2.connect( host="localhost", database="geutebruck", user="postgres", password="postgres123" ) cur = conn.cursor() # Find mappings (excluding TEST mappings) cur.execute(""" SELECT id, name, input_action, output_actions, enabled, created_at FROM action_mappings WHERE name NOT LIKE 'TEST%' AND name NOT LIKE 'BACKEND%' ORDER BY id LIMIT 5 """) mappings = cur.fetchall() print("=" * 80) print("WORKING MAPPINGS FROM DATABASE") print("=" * 80) for mapping in mappings: print(f"\nID: {mapping[0]}") print(f"Name: {mapping[1]}") print(f"Input Action: {mapping[2]}") print(f"Output Actions (raw JSON):") print(json.dumps(mapping[3], indent=2)) print(f"Enabled: {mapping[4]}") print(f"Created: {mapping[5]}") print("-" * 80) cur.close() conn.close() if __name__ == '__main__': check_mappings()