MaCH repo

This commit is contained in:
2025-07-24 12:46:01 -05:00
committed by Nick Ricketts
commit 46e598475e
60 changed files with 5021 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
CREATE TABLE greetings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);

View File

@@ -0,0 +1,3 @@
select name
from greetings
limit 1;

View File

@@ -0,0 +1,7 @@
<html>
<body>
{{#greeting}}
<p>Hello {{name}}</p>
{{/greeting}}
</body>
</html>

View File

@@ -0,0 +1,20 @@
#include <mach.h>
#include <sqlite.h>
void mach(){
resource("home", "/",
.get = {
sqlite_query({"hello_db", "get_hello_world", "greeting"}),
mustache("hello_world")
}
);
sqlite_database(
.name = "hello_db",
.connect = "file:hello.db?mode=rwc",
.migrations = {"create_hello_world_table"},
.seeds = {"seed_hello_world"}
);
sqlite();
}

View File

@@ -0,0 +1,2 @@
INSERT INTO greetings(name)
VALUES('World');