You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PhishingAwarenessSimulation/Assets/Scripts/SupabaseTestInsert.cs

40 lines
945 B
C#

using UnityEngine;
using Supabase;
using System;
using Postgrest.Models;
using Postgrest.Attributes;
public class SupabaseTestInsert : MonoBehaviour
{
async void Start()
{
var gameEvent = new GameEvent
{
Id = Guid.NewGuid(),
EventKey = "manual_test_event",
Timestamp = DateTime.UtcNow,
UserId = "test_user_1"
};
Debug.Log("🔍 Trying test insert...");
await Client.Instance.From<GameEvent>().Insert(gameEvent);
Debug.Log("✅ Test insert complete");
}
[Table("game_events")]
public class GameEvent : BaseModel
{
[PrimaryKey("id", false)]
public Guid Id { get; set; }
[Column("event_key")]
public string EventKey { get; set; }
[Column("timestamp")]
public DateTime Timestamp { get; set; }
[Column("user_id")]
public string UserId { get; set; }
}
}