mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 06:21:09 +02:00
feat(chat): integrate chat project into monorepo with full app structure
- Restructure chat as apps/mobile, apps/web, apps/landing, backend - Add NestJS backend for secure Azure OpenAI API calls - Remove exposed API key from mobile app (security fix) - Add shared chat-types package - Create SvelteKit web app scaffold - Create Astro landing page scaffold - Update pnpm workspace configuration - Add project-level CLAUDE.md documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
fcf3a344b1
commit
c638a7ffee
155 changed files with 22622 additions and 348 deletions
52
chat/apps/mobile/scripts/setup_supabase_functions.sql
Normal file
52
chat/apps/mobile/scripts/setup_supabase_functions.sql
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
-- Erstelle eine Funktion zum Ausführen von SQL-Abfragen
|
||||
CREATE OR REPLACE FUNCTION execute_sql(query text)
|
||||
RETURNS JSONB
|
||||
LANGUAGE plpgsql
|
||||
SECURITY DEFINER
|
||||
AS $$
|
||||
DECLARE
|
||||
result JSONB;
|
||||
BEGIN
|
||||
EXECUTE 'SELECT jsonb_agg(row_to_json(t)) FROM (' || query || ') t' INTO result;
|
||||
RETURN COALESCE(result, '[]'::jsonb);
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
RAISE EXCEPTION 'SQL-Fehler: %', SQLERRM;
|
||||
END;
|
||||
$$;
|
||||
|
||||
-- Erstelle eine Funktion zum Erstellen der models-Tabelle, falls sie nicht existiert
|
||||
CREATE OR REPLACE FUNCTION create_models_table()
|
||||
RETURNS VOID
|
||||
LANGUAGE plpgsql
|
||||
SECURITY DEFINER
|
||||
AS $$
|
||||
BEGIN
|
||||
-- Prüfe, ob die Tabelle bereits existiert
|
||||
IF NOT EXISTS (
|
||||
SELECT FROM information_schema.tables
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'models'
|
||||
) THEN
|
||||
-- Erstelle die Tabelle
|
||||
CREATE TABLE models (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT,
|
||||
parameters JSONB,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Erstelle einen Trigger für updated_at
|
||||
CREATE TRIGGER set_updated_at
|
||||
BEFORE UPDATE ON models
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION set_updated_at();
|
||||
|
||||
RAISE NOTICE 'Tabelle models wurde erstellt.';
|
||||
ELSE
|
||||
RAISE NOTICE 'Tabelle models existiert bereits.';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
Loading…
Add table
Add a link
Reference in a new issue