{"id":22352836,"url":"https://github.com/jrycw/edgedb-ia","last_synced_at":"2026-02-28T05:13:47.610Z","repository":{"id":219909305,"uuid":"750233593","full_name":"jrycw/edgedb-ia","owner":"jrycw","description":"EdgeDB learning material in Traditional Chinese.","archived":false,"fork":false,"pushed_at":"2024-08-06T08:55:09.000Z","size":1814,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T12:14:12.996Z","etag":null,"topics":["database","edgedb"],"latest_commit_sha":null,"homepage":"https://jrycw.github.io/edgedb-ia/","language":"EdgeQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrycw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-30T08:46:37.000Z","updated_at":"2024-08-06T08:54:58.000Z","dependencies_parsed_at":"2024-11-02T07:30:44.373Z","dependency_job_id":"09772585-d62c-4aa5-af7f-f401646823fb","html_url":"https://github.com/jrycw/edgedb-ia","commit_stats":null,"previous_names":["jrycw/edgedb-ia"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jrycw/edgedb-ia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrycw%2Fedgedb-ia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrycw%2Fedgedb-ia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrycw%2Fedgedb-ia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrycw%2Fedgedb-ia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrycw","download_url":"https://codeload.github.com/jrycw/edgedb-ia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrycw%2Fedgedb-ia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29925683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","edgedb"],"created_at":"2024-12-04T12:28:01.748Z","updated_at":"2026-02-28T05:13:47.593Z","avatar_url":"https://github.com/jrycw.png","language":"EdgeQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# edgedb-ia\n## 緣起\n這個project的概念源自[Easy EdgeDB](https://www.edgedb.com/easy-edgedb)。書內用吸血鬼為主題，帶領讀者一步步跟著故事，使用EdgeDB來模擬，是一份相當好的學習資源。\n\n在閱讀完Easy EdgeDB之後，因為太喜歡這種學習方式，所以我決定找一部很喜歡的電影，[無間道系列第一集](https://zh.wikipedia.org/zh-tw/%E7%84%A1%E9%96%93%E9%81%93)，以類似的技巧來練習EdgeDB。\n\n我們會先建立一個初始schema，裡面包含了基本的人時地事。接著再從劇中選出十幕，於每幕中交待劇情，熟悉query寫法、逐步改善schema並進行migration。\n\n如果您在尋找[EdgeDB的正體中文教材](https://jrycw.github.io/edgedb-ia/)，相信這個project應該能帶給您些許收獲。\n\n## Scenes\n* [01 - 韓琛初現](https://jrycw.github.io/edgedb-ia/scenes/scene01/scene01/)\n* [02 - 我想跟他換](https://jrycw.github.io/edgedb-ia/scenes/scene02/scene02/)\n* [03 - 黑白顛倒](https://jrycw.github.io/edgedb-ia/scenes/scene03/scene03/)\n* [04 - 被遺忘的時光](https://jrycw.github.io/edgedb-ia/scenes/scene04/scene04/)\n* [05 - 三年之後又三年](https://jrycw.github.io/edgedb-ia/scenes/scene05/scene05/)\n* [06 - 有內鬼終止交易](https://jrycw.github.io/edgedb-ia/scenes/scene06/scene06/)\n* [07 - 互猜底牌](https://jrycw.github.io/edgedb-ia/scenes/scene07/scene07/)\n* [08 - 誰是內鬼](https://jrycw.github.io/edgedb-ia/scenes/scene08/scene08/)\n* [09 - 真相大白](https://jrycw.github.io/edgedb-ia/scenes/scene09/scene09/)\n* [10 - 我想做個好人](https://jrycw.github.io/edgedb-ia/scenes/scene10/scene10/)\n\n## Initial schema\n``` elm\nmodule default {\n\n    # scalar types\n    scalar type PoliceRank extending enum\u003cProtected, Cadet, PC, SPC, SGT, SSGT, PI, IP, SIP, CIP,\n                                          SP, SSP, CSP, ACP, SACP, DCP, CP\u003e;\n    scalar type GangsterRank extending enum\u003cNobody, Leader, Boss\u003e;\n    scalar type DayOfWeek extending enum\u003cMonday, Tuesday, Wednesday, Thursday, Friday,\n                                         Saturday, Sunday\u003e;\n\n    scalar type FuzzyYear extending int64;\n    scalar type FuzzyMonth extending int64 {\n                constraint expression on (__subject__ \u003e=1 and __subject__ \u003c=12)\n    }\n    scalar type FuzzyDay extending int64 {\n                constraint expression on (__subject__ \u003e=1 and __subject__ \u003c=31)\n    }\n    scalar type FuzzyHour extending int64 {\n                constraint expression on (__subject__ \u003e=0 and __subject__ \u003c=23)\n    }\n    scalar type FuzzyMinute extending int64 {\n                constraint expression on (__subject__ \u003e=0 and __subject__ \u003c=59)\n    }\n    scalar type FuzzySecond extending int64 {\n                constraint expression on (__subject__ \u003e=0 and __subject__ \u003c=59)\n    }\n\n    scalar type SceneNumber extending sequence;\n\n    # abstract object types\n    abstract type Person {\n        required name: str;\n        nickname: str;\n        eng_name: str;\n    }\n\n    abstract type IsPolice {\n        police_rank: PoliceRank{\n            default:= PoliceRank.Cadet;\n        };\n        dept: str;\n        is_officer:= .police_rank \u003e= PoliceRank.PI;\n    }\n\n    abstract type IsGangster {\n        gangster_rank: GangsterRank {\n            default:= GangsterRank.Nobody;\n        };\n        gangster_boss: GangsterBoss;\n    }\n\n    abstract type IsSpy extending IsPolice, IsGangster;\n\n    abstract type Place {\n        required name: str {\n            delegated constraint exclusive;\n        };\n    }\n\n    abstract type Event {\n        detail: str;\n        multi who: Character;\n        multi `when`: FuzzyTime;\n        multi where: Place;\n    }\n\n    # object types\n    type Character extending Person {\n        classic_lines: array\u003cstr\u003e;\n        lover: Character;\n        multi actors: Actor;\n    }\n\n    type Actor extending Person;\n    type Police extending Character, IsPolice;\n    type Gangster extending Character, IsGangster;\n\n    type GangsterBoss extending Gangster {\n        overloaded gangster_rank: GangsterRank {\n            default:= GangsterRank.Boss;\n            constraint expression on (__subject__ = GangsterRank.Boss);\n        };\n\n        # excluding self\n        constraint expression on (__subject__ != .gangster_boss) { \n            errmessage := \"The boss can't be his/her own boss.\";\n        }\n    }\n\n    type PoliceSpy extending Character, IsSpy;\n    type GangsterSpy extending Character, IsSpy {\n        overloaded police_rank: PoliceRank {\n            default:= PoliceRank.Protected;\n        }\n    };\n\n    type Landmark extending Place;\n    type Location extending Place;\n    type Store extending Place;\n\n    type FuzzyTime {\n        fuzzy_year: FuzzyYear;\n        fuzzy_month: FuzzyMonth;\n        fuzzy_day: FuzzyDay;\n        fuzzy_hour: FuzzyHour;\n        fuzzy_minute: FuzzyMinute;\n        fuzzy_second: FuzzySecond;\n        fuzzy_dow: DayOfWeek; \n        fuzzy_fmt:= (\n            with Y:= \u003cstr\u003e.fuzzy_year ?? \"YYYY\",\n                 m:= \u003cstr\u003e.fuzzy_month ?? \"MM\",\n                 m:= m if len(m) \u003e 1 else \"0\" ++ m,\n                 d:= \u003cstr\u003e.fuzzy_day ?? \"DD\",\n                 d:= d if len(d) \u003e 1 else \"0\" ++ d,\n                 H:= \u003cstr\u003e.fuzzy_hour ?? \"HH24\",\n                 H:= H if len(H) \u003e 1 else \"0\" ++ H,\n                 M:= \u003cstr\u003e.fuzzy_minute ?? \"MI\",\n                 M:= M if len(M) \u003e 1 else \"0\" ++ M,\n                 S:= \u003cstr\u003e.fuzzy_second ?? \"SS\",\n                 S:= S if len(S) \u003e 1 else \"0\" ++ S,\n                 dow:= \u003cstr\u003e.fuzzy_dow ?? \"ID\", \n            select Y ++ \"/\" ++ m ++ \"/\" ++ d ++ \"_\" ++\n                   H ++ \":\" ++ M ++ \":\" ++ S ++ \"_\" ++\n                   dow       \n        );\n    \n        trigger fuzzy_month_day_check after insert, update for each \n        when (exists __new__.fuzzy_month and exists __new__.fuzzy_day) \n        do ( \n            assert_exists(\n                cal::to_local_date(__new__.fuzzy_year ?? 2002, __new__.fuzzy_month, __new__.fuzzy_day),\n                ) \n        );\n        constraint exclusive on (.fuzzy_fmt);\n    }\n\n    type Scene extending Event {\n        title: str;\n        remarks: str;\n        references: array\u003ctuple\u003cstr, str\u003e\u003e;\n        required scene_number: SceneNumber {\n            constraint exclusive;\n            default := sequence_next(introspect SceneNumber);\n        }\n        index on (.scene_number);\n    }\n\n}\n```\n## Final schema\n``` elm\nusing extension pg_trgm;\nusing extension pgcrypto;\n\nmodule default {\n    # global types\n    global current_user_id: uuid;\n\n    # scalar types\n    scalar type PoliceRank extending enum\u003cProtected, Cadet, PC, SPC, SGT, SSGT, PI, IP, SIP, CIP,\n                                          SP, SSP, CSP, ACP, SACP, DCP, CP\u003e;\n    scalar type GangsterRank extending enum\u003cNobody, Leader, Boss\u003e;\n    scalar type DayOfWeek extending enum\u003cMonday, Tuesday, Wednesday, Thursday, Friday,\n                                         Saturday, Sunday\u003e;\n\n    scalar type FuzzyYear extending int64;\n    scalar type FuzzyMonth extending int64 {\n                constraint expression on (__subject__ \u003e=1 and __subject__ \u003c=12)\n    }\n    scalar type FuzzyDay extending int64 {\n                constraint expression on (__subject__ \u003e=1 and __subject__ \u003c=31)\n    }\n    scalar type FuzzyHour extending int64 {\n                constraint expression on (__subject__ \u003e=0 and __subject__ \u003c=23)\n    }\n    scalar type FuzzyMinute extending int64 {\n                constraint expression on (__subject__ \u003e=0 and __subject__ \u003c=59)\n    }\n    scalar type FuzzySecond extending int64 {\n                constraint expression on (__subject__ \u003e=0 and __subject__ \u003c=59)\n    }\n\n    scalar type SceneNumber extending sequence;\n    scalar type TeamTreatNumber extending sequence; \n\n    # abstract object types\n    abstract type Person {\n        required name: str;\n        nickname: str;\n        eng_name: str;\n    }\n\n    abstract type IsPolice {\n        police_rank: PoliceRank{\n            default:= PoliceRank.Cadet;\n        };\n        dept: str;\n        is_officer:= .police_rank \u003e= PoliceRank.PI;\n    }\n    \n    abstract type IsGangster {\n        gangster_rank: GangsterRank {\n            default:= GangsterRank.Nobody;\n        };\n        gangster_boss: GangsterBoss;\n    }\n\n    abstract type IsSpy extending IsPolice, IsGangster;\n\n    abstract type Place {\n        required name: str {\n            delegated constraint exclusive;\n        };\n    }\n\n    abstract type Event {\n        detail: str;\n        multi who: Character;\n        multi `when`: FuzzyTime;\n        multi where: Place;\n    }\n\n    abstract type Archive;\n\n    # object types\n    type Envelope {\n        name: str {\n            default:= \"標\";\n            readonly:= true\n        };\n        access policy allow_select_insert_delete\n            allow select, insert, delete;\n\n        access policy only_one_envelope_exists\n            deny insert\n            using (exists Envelope)\n            {\n                errmessage := 'Only one Envelope can be existed.'\n            };\n    }\n\n    type Beverage {\n        required name: str;\n        produced_by: Store;\n        consumed_by: Character;\n        `when`: FuzzyTime;\n        where: Place;\n    }\n\n    type CIBTeamTreat {\n        required team_treat_number: TeamTreatNumber {\n            constraint exclusive;\n            default := sequence_next(introspect TeamTreatNumber);\n        }\n        multi colleagues: Police {\n            default:= (select Police filter .dept=\"刑事情報科(CIB)\");\n            readonly := true;\n            point: int64 {\n                default:= \u003cint64\u003emath::ceil(random()*10)\n            }\n        };\n        team_treat:= max(.colleagues@point) \u003e= 9\n    }\n\n    type Character extending Person {\n        classic_lines: array\u003cstr\u003e;\n        multi lovers: Character;\n        multi actors: Actor;\n    }\n\n    type Actor extending Person;\n    type Police extending Character, IsPolice;\n    type Gangster extending Character, IsGangster;\n\n    type GangsterBoss extending Gangster {\n        overloaded gangster_rank: GangsterRank {\n            default:= GangsterRank.Boss;\n            constraint expression on (__subject__ = GangsterRank.Boss);\n        };\n\n        # excluding self\n        constraint expression on (__subject__ != .gangster_boss) { \n            errmessage := \"The boss can't be his/her own boss.\";\n        }\n    }\n\n    type PoliceSpy extending Character, IsSpy {\n        access policy authorized_allow_insert_update_delete\n            allow insert, update, delete\n            using (with police_officer:= (select IsPolice filter .id = global current_user_id),\n                select if exists police_officer then (\n                        police_officer.police_rank ?? PoliceRank.PC \u003e= PoliceRank.DCP\n                    ) else (\n                        false\n                    )                                                                                                                  \n            )\n            {\n                errmessage := \"PoliceRank required: PoliceRank.DCP\"\n            };\n\n        access policy authorized_allow_select\n            allow select\n            using (with police_officer:= (select IsPolice filter .id = global current_user_id),\n                select if exists police_officer then (\n                        police_officer.police_rank ?? PoliceRank.PC \u003e= PoliceRank.SP\n                    ) else (\n                        false\n                    )                                                                                                                  \n            )\n            {\n                errmessage := \"PoliceRank required: PoliceRank.SP\"\n            };\n\n    };\n    \n    type GangsterSpy extending Character, IsSpy {\n        overloaded police_rank: PoliceRank {\n            default:= PoliceRank.Protected;\n        }\n    };\n\n    type Landmark extending Place;\n    type Location extending Place;\n    type Store extending Place;\n\n    type FuzzyTime {\n        fuzzy_year: FuzzyYear;\n        fuzzy_month: FuzzyMonth;\n        fuzzy_day: FuzzyDay;\n        fuzzy_hour: FuzzyHour;\n        fuzzy_minute: FuzzyMinute;\n        fuzzy_second: FuzzySecond;\n        fuzzy_dow: DayOfWeek; \n        fuzzy_fmt:= (\n            with Y:= \u003cstr\u003e.fuzzy_year ?? \"YYYY\",\n                 m:= \u003cstr\u003e.fuzzy_month ?? \"MM\",\n                 m:= m if len(m) \u003e 1 else \"0\" ++ m,\n                 d:= \u003cstr\u003e.fuzzy_day ?? \"DD\",\n                 d:= d if len(d) \u003e 1 else \"0\" ++ d,\n                 H:= \u003cstr\u003e.fuzzy_hour ?? \"HH24\",\n                 H:= H if len(H) \u003e 1 else \"0\" ++ H,\n                 M:= \u003cstr\u003e.fuzzy_minute ?? \"MI\",\n                 M:= M if len(M) \u003e 1 else \"0\" ++ M,\n                 S:= \u003cstr\u003e.fuzzy_second ?? \"SS\",\n                 S:= S if len(S) \u003e 1 else \"0\" ++ S,\n                 dow:= \u003cstr\u003e.fuzzy_dow ?? \"ID\", \n            select Y ++ \"/\" ++ m ++ \"/\" ++ d ++ \"_\" ++\n                   H ++ \":\" ++ M ++ \":\" ++ S ++ \"_\" ++\n                   dow       \n        );\n    \n        trigger fuzzy_month_day_check after insert, update for each \n        when (exists __new__.fuzzy_month and exists __new__.fuzzy_day) \n        do ( \n            assert_exists(\n                cal::to_local_date(__new__.fuzzy_year ?? 2002, __new__.fuzzy_month, __new__.fuzzy_day),\n                ) \n        );\n        constraint exclusive on (.fuzzy_fmt);\n    }\n\n    type CriminalRecord extending Archive {\n        required ref_no: str {\n            constraint exclusive;\n        };\n        required code: str;\n        multi involved: Character;\n        created_at: datetime {\n            readonly := true;\n            rewrite insert using (datetime_of_statement())\n        }\n        modified_at: datetime {\n            rewrite update using (datetime_of_statement())\n        }\n    }\n\n    type PoliceSpyFile extending Archive {\n        multi colleagues: PoliceSpy;\n        classified_info: str; \n\n        access policy authorized_allow_all\n            allow all\n            using (with police_officer:= (select IsPolice filter .id = global current_user_id),\n                select if exists police_officer then (\n                        police_officer.police_rank ?? PoliceRank.PC \u003e= PoliceRank.SP\n                    ) else (\n                        false\n                    )                                                                                                                  \n            )\n        {\n            errmessage := \"PoliceRank required: PoliceRank.SP\"\n        };\n    }\n\n    type ChenLauContact extending Event {\n        how: str;\n        overloaded who: Character {default:= {chen, lau}}\n    }\n\n    type Scene extending Event {\n        title: str;\n        remarks: str;\n        references: array\u003ctuple\u003cstr, str\u003e\u003e;\n        required scene_number: SceneNumber {\n            constraint exclusive;\n            default := sequence_next(introspect SceneNumber);\n        }\n        index on (.scene_number);\n    }\n\n    # alias\n    alias hon:= assert_exists(assert_single((select GangsterBoss filter .name = \"韓琛\")));\n    alias lau:= assert_exists(assert_single((select GangsterSpy filter .name = \"劉建明\")));\n    alias chen:= assert_exists(assert_single((select PoliceSpy filter .name = \"陳永仁\")));\n    alias wong:= assert_exists(assert_single((select Police filter .name = \"黃志誠\")));\n\n    alias police_station:= assert_exists(assert_single((select Landmark filter .name=\"警察局\")));\n\n    alias year_1992:= assert_exists(assert_single((select FuzzyTime \n                                        filter .fuzzy_year = 1992 \n                                        and .fuzzy_month ?= \u003cFuzzyMonth\u003e{}\n                                        and .fuzzy_day ?= \u003cFuzzyDay\u003e{}\n                                        and .fuzzy_hour ?= \u003cFuzzyHour\u003e{}\n                                        and .fuzzy_minute ?= \u003cFuzzyMinute\u003e{}\n                                        and .fuzzy_second ?= \u003cFuzzySecond\u003e{}   \n                                        and .fuzzy_dow ?= \u003cDayOfWeek\u003e{}\n                    ))\n    );\n    alias year_1994:= assert_exists(assert_single((select FuzzyTime \n                                        filter .fuzzy_year = 1994 \n                                        and .fuzzy_month ?= \u003cFuzzyMonth\u003e{}\n                                        and .fuzzy_day ?= \u003cFuzzyDay\u003e{}\n                                        and .fuzzy_hour ?= \u003cFuzzyHour\u003e{}\n                                        and .fuzzy_minute ?= \u003cFuzzyMinute\u003e{}\n                                        and .fuzzy_second ?= \u003cFuzzySecond\u003e{}   \n                                        and .fuzzy_dow ?= \u003cDayOfWeek\u003e{}\n                    ))\n    );\n    alias year_2002:= assert_exists(assert_single((select FuzzyTime \n                                        filter .fuzzy_year = 2002 \n                                        and .fuzzy_month ?= \u003cFuzzyMonth\u003e{}\n                                        and .fuzzy_day ?= \u003cFuzzyDay\u003e{}\n                                        and .fuzzy_hour ?= \u003cFuzzyHour\u003e{}\n                                        and .fuzzy_minute ?= \u003cFuzzyMinute\u003e{}\n                                        and .fuzzy_second ?= \u003cFuzzySecond\u003e{}   \n                                        and .fuzzy_dow ?= \u003cDayOfWeek\u003e{}\n                    ))\n    );\n\n    # undercover\n    alias morse_code_of_undercover:= str_replace(\"..- -. -.. . .-. -.-. --- ...- . .-.\", \"-\", \"_\");\n\n    # functions\n    function is_hi_fi_store_open(dow: DayOfWeek, visit_hour: int64) -\u003e bool\n    #\n    # The store will open 11:00~22:00 everyday, except:\n    # will close on Wednesdays.\n    # will close during 13:00~14:00 and 19:00~20:00 everyday.\n    #\n    using (\n        with open_hours:= multirange([range(11, 13), range(14, 19), range(20, 22)])\n        select dow != DayOfWeek.Wednesday and contains(open_hours, visit_hour)\n    );\n\n    function get_stored_encrypted_password() -\u003e str\n    #\n    # This function simulates retrieving the underlying stored encrypted password.\n    #\n    using (\n        with code:= morse_code_of_undercover,\n             module ext::pgcrypto, \n        select crypt(code, gen_salt())\n    );\n\n    function validate_password(code: str) -\u003e bool\n    #\n    # https://www.edgedb.com/docs/stdlib/pgcrypto\n    # \n    # Usage:\n    # db\u003e select validate_password(morse_code_of_undercover);\n    #\n    using (\n        with hash:= get_stored_encrypted_password(),\n             module ext::pgcrypto,\n        select crypt(code, hash) = hash\n    );\n\n    function list_police_spy_names(code: str) -\u003e json\n    #\n    # Noted that PoliceSpyFile is secured by the defined access policies.\n    # Usage:\n    # db\u003e select list_police_spy_names(morse_code_of_undercover);\n    # or \n    # wrapped in an api enpoint\n    #\n    using (\n        with police_spy_file:= PoliceSpyFile if validate_password(code)\n                               else \u003cPoliceSpyFile\u003e{},\n             names:= array_agg(police_spy_file.colleagues.name),\n        select json_object_pack({(\"names\", \u003cjson\u003e(names))})\n    );\n\n    # tests\n    function test_alias() -\u003e bool\n    using (all({\n            test_scene01_alias(),\n            test_scene02_alias(),\n            test_scene03_alias(),\n            test_scene05_alias(),\n            test_scene09_alias(),\n        })\n    );\n\n    function test_scene01_alias() -\u003e bool\n    using (all({\n            (exists hon),          \n            (exists lau),\n            (exists year_1992),   \n        })\n    );\n\n    function test_scene02_alias() -\u003e bool\n    using (all({\n            (exists chen),          \n            (exists wong), \n        })\n    );\n\n    function test_scene03_alias() -\u003e bool\n    using (all({\n            (exists year_1994),   \n            (exists police_station),   \n        })\n    );\n\n    function test_scene05_alias() -\u003e bool\n    using (all({\n            (exists year_1994),\n        })\n    );\n\n    function test_scene09_alias() -\u003e bool\n    using (all({\n            (exists morse_code_of_undercover),\n        })\n    );\n\n    function test_hi_fi_store_open() -\u003e bool\n    using (all({\n          is_hi_fi_store_open(DayOfWeek.Monday, 12),\n          is_hi_fi_store_open(DayOfWeek.Friday, 15),\n          is_hi_fi_store_open(DayOfWeek.Saturday, 21),\n        })\n    );\n\n    function test_hi_fi_store_close() -\u003e bool \n    using (not all({\n          is_hi_fi_store_open(DayOfWeek.Wednesday, 12),\n          is_hi_fi_store_open(DayOfWeek.Thursday, 13),\n          is_hi_fi_store_open(DayOfWeek.Sunday, 19),\n        })\n    );\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrycw%2Fedgedb-ia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrycw%2Fedgedb-ia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrycw%2Fedgedb-ia/lists"}