40 lines
945 B
C#
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; }
|
|||
|
}
|
|||
|
}
|