完成Haskell部分的SQL词法分析器

This commit is contained in:
LIm1tZz7 committed 2026-09-19 19:22:50 +08:00
commit a9ef1ef3e2
21 files changed
+1547

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
module ChuSQL.Model where
-- 列的值:整数、字符串、布尔
data Value
= VInt Int
| VStr String
| VBool Bool
deriving (Show, Eq)
-- 一行:列名 → 值
type Row = [(String, Value)]
-- 一张表
data Table = Table
{ tableName :: String
, tableCols :: [String]
, tableRows :: [Row]
}
deriving (Show)
-- 数据库:多张表
type Database = [(String, Table)]