Datasets:
Download web/relvyn.example/reference/site/showcase/data-modeling/index.html from Qwen/RecreationBench: direct link, hf CLI and curl.
- Browser
- Download file 33.7 kB
-
https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/relvyn.example/reference/site/showcase/data-modeling/index.html
- Command line
-
hf download hf://datasets/Qwen/RecreationBench/web/relvyn.example/reference/site/showcase/data-modeling/index.html
-
curl -L -o index.html https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/relvyn.example/reference/site/showcase/data-modeling/index.html
33.7 kB
| <html data-theme="dark" lang="en" style="background-color:#1a1a1a"><head><meta charset="utf-8"/><meta content="width=device-width" name="viewport"/><title>Modeling in Relvyn | Relvyn</title><link href="/showcase/data-modeling" rel="canonical"/><link href="/rss.xml" rel="alternate" title="Our Blog" type="application/rss+xml"/><meta content="Relvyn ships a native declarative language for describing your schema, wired tightly into its query language, type system, and migration tooling for developers." name="description" property="description"/><meta content="Data modeling in Relvyn | Relvyn" name="og:title" property="og:title"/><meta content="website" name="og:type" property="og:type"/><meta content="Relvyn ships a native declarative language for describing your schema, wired tightly into its query language, type system, and migration tooling for developers." name="og:description" property="og:description"/><meta content="/logos/tw_card_intro.png" name="og:image" property="og:image"/><meta content="/showcase/data-modeling" name="og:url" property="og:url"/><meta content="summary_large_image" name="twitter:card"/><meta content="Data modeling in Relvyn | Relvyn" name="twitter:title"/><meta content="Relvyn provides a first-party declarative schema modeling language that integrates deeply with Relvyn's query language, type system, and migration tools." name="twitter:description"/><meta content="/logos/tw_card_intro.png" name="twitter:image"/><meta content="Relvyn provides a first-party declarative schema modeling language that integrates deeply with Relvyn's query language, type system, and migration tools." name="twitter:image:alt"/><meta content="@relvyn" name="twitter:site"/><meta content="17" name="next-head-count"/><link href="/apple-touch-icon.png" rel="apple-touch-icon" sizes="120x120"/><link href="/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/><link href="/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/><link href="/site.webmanifest" rel="manifest"/><link color="#8FAF24" href="/safari-pinned-tab.svg" rel="mask-icon"/><meta content="#8FAF24" name="msapplication-TileColor"/><meta content="#ffffff" name="theme-color"/><link as="font" crossorigin="anonymous" href="/assets/fonts/edgedb-700.woff2" rel="preload" type="font/woff2"/><link as="font" crossorigin="anonymous" href="/assets/fonts/roboto-mono-latin-400.woff2" rel="preload" type="font/woff2"/><link as="font" crossorigin="anonymous" href="/assets/fonts/open-sans-latin-400.woff2" rel="preload" type="font/woff2"/><link as="font" crossorigin="anonymous" href="/assets/fonts/open-sans-latin-400italic.woff2" rel="preload" type="font/woff2"/><link as="font" crossorigin="anonymous" href="/assets/fonts/open-sans-latin-700.woff2" rel="preload" type="font/woff2"/><link as="font" crossorigin="anonymous" href="/assets/fonts/open-sans-latin-800.woff2" rel="preload" type="font/woff2"/><link as="style" href="/_next/static/css/0c786f97c9ee5e99.css" rel="preload"/><link data-n-g="" href="/_next/static/css/0c786f97c9ee5e99.css" rel="stylesheet"/><link as="style" href="/_next/static/css/d071c2cb70bc16a1.css" rel="preload"/><link data-n-p="" href="/_next/static/css/d071c2cb70bc16a1.css" rel="stylesheet"/><link as="style" href="/_next/static/css/aa15d4183691bd99.css" rel="preload"/><link data-n-p="" href="/_next/static/css/aa15d4183691bd99.css" rel="stylesheet"/><link as="style" href="/_next/static/css/db452bb98fdfd5cc.css" rel="preload"/><link data-n-p="" href="/_next/static/css/db452bb98fdfd5cc.css" rel="stylesheet"/><style>*,*::before,*::after{animation-duration:0s;animation-delay:0s;transition-duration:0s;transition-delay:0s;scroll-behavior:auto;caret-color:transparent}</style></head><body><div id="__next"><div style="display:contents"><div class="layout_mainLayout__LbTrz showcase_page__lk50E"><div class="globalBanner_globalBannerContainer__t_yA2"><div class="globalBanner_globalBanner__Ai1We"><div class="globalBanner_bannerMessage__KBNQd">Relvyn launches <a href="/blog/gel-joins-vercel">Read the announcement <svg height="35" viewbox="0 0 35 35" width="35"><path d="M23.49 18.807H7.245a1.5 1.5 0 0 1 0-3H23.49l-3.7-3.697a1.5 1.5 0 0 1 2.122-2.122l6.259 6.26a1.495 1.495 0 0 1 0 2.121l-6.26 6.259a1.5 1.5 0 1 1-2.12-2.121l3.698-3.699z"></path></svg></a></div></div></div><div class="pageNav_pageHeader__1p8px"><div class="pageNav_headerWrapper__tKciy"><a class="pageNav_headerLogo__kBUdU" href="/"><svg fill="none" height="122" viewbox="0 0 157 122" width="157" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M31 30a31 31 0 1 0 0 62 31 31 0 0 0 0-62Zm0 18a13 13 0 1 1 0 26 13 13 0 0 1 0-26Z" fill="currentColor"></path><rect x="74" y="4" width="20" height="114" rx="10" fill="currentColor"></rect><path d="M110 90 133 44 156 90Z" fill="currentColor"></path></svg></a><div class="pageNav_pageNav__WKW_2"><div class="pageNav_center__tO0MP"><nav><ul class="pageNav_links__YuK5G"><li class="pageNav_textLink__Nx8DP"><a href="/"><span>Product</span></a></li><li class="pageNav_textLink__Nx8DP"><a href="/_404.html"><span>Docs</span></a></li><li class="pageNav_textLink__Nx8DP"><a href="/blog"><span>Blog</span></a></li></ul><a class="pageNav_cloudLink__z77Wq" href="/_404.html"><svg fill="none" height="15" viewbox="0 0 25 15" width="25" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.5 15C3.18629 15 0.5 12.3137 0.5 9C0.5 5.68647 3.18599 3.0003 6.49945 3C7.86776 1.17833 10.0463 0 12.5 0C16.1293 0 19.1565 2.57787 19.8505 6.00244C19.9001 6.00082 19.95 6 20 6C22.4853 6 24.5 8.01472 24.5 10.5C24.5 12.9853 22.4853 15 20 15H12.5H6.5Z" fill="currentColor" fill-rule="evenodd"></path></svg><span>Sign in</span></a></nav><div class="pageNav_socialLinks__xHaqe"><div class="pageNav_spacer__I4_Lc"></div><a class="pageNav_githubStars__meN0H" href="/_cdn/github.com/geldata/gel"><svg height="35" viewbox="0 0 35 35" width="35"><path d="M17.5 3.5 L20.6 14.4 L31.5 17.5 L20.6 20.6 L17.5 31.5 L14.4 20.6 L3.5 17.5 L14.4 14.4 Z" fill="currentColor" fill-rule="evenodd"></path></svg><span>14.0k</span></a><div class="pageNav_spacer__I4_Lc"></div><a class="pageNav_discord__yhl_6" href="/p/discord"><svg fill="none" height="35" viewbox="0 0 35 35" width="35" xmlns="http://www.w3.org/2000/svg"><path d="M28.7657 7.07236C26.6752 6.11316 24.4334 5.40646 22.0896 5.0017C22.0469 4.99389 22.0042 5.01341 21.9823 5.05245C21.694 5.56523 21.3746 6.23419 21.151 6.75999C18.63 6.38257 16.1219 6.38257 13.6526 6.75999C13.4289 6.2225 13.098 5.56523 12.8084 5.05245C12.7864 5.01471 12.7438 4.99519 12.7011 5.0017C10.3585 5.40516 8.11677 6.11186 6.02498 7.07236C6.00687 7.08017 5.99135 7.0932 5.98105 7.11011C1.72894 13.4627 0.564116 19.6591 1.13554 25.7787C1.13813 25.8086 1.15493 25.8372 1.1782 25.8554C3.98362 27.9157 6.70115 29.1664 9.36821 29.9954C9.41089 30.0085 9.45612 29.9929 9.48328 29.9577C10.1142 29.0962 10.6766 28.1877 11.1588 27.2324C11.1872 27.1764 11.16 27.1101 11.1019 27.0879C10.2098 26.7496 9.36045 26.337 8.54338 25.8685C8.47876 25.8307 8.47358 25.7383 8.53304 25.694C8.70498 25.5652 8.87696 25.4311 9.04114 25.2958C9.07085 25.2711 9.11224 25.2658 9.14716 25.2815C14.5149 27.7322 20.3261 27.7322 25.6306 25.2815C25.6655 25.2645 25.7069 25.2698 25.7379 25.2945C25.9021 25.4298 26.074 25.5652 26.2473 25.694C26.3067 25.7383 26.3029 25.8307 26.2382 25.8685C25.4212 26.3461 24.5718 26.7496 23.6784 27.0866C23.6203 27.1088 23.5944 27.1764 23.6229 27.2324C24.1154 28.1864 24.6778 29.0948 25.297 29.9564C25.3229 29.9929 25.3694 30.0085 25.4121 29.9954C28.0921 29.1664 30.8096 27.9157 33.615 25.8554C33.6396 25.8372 33.6551 25.8099 33.6577 25.7799C34.3416 18.705 32.5122 12.5594 28.8083 7.1114C28.7993 7.0932 28.7838 7.08017 28.7657 7.07236ZM11.9603 22.0525C10.3443 22.0525 9.01269 20.5688 9.01269 18.7467C9.01269 16.9246 10.3185 15.4409 11.9603 15.4409C13.6151 15.4409 14.9338 16.9376 14.9079 18.7467C14.9079 20.5688 13.6022 22.0525 11.9603 22.0525ZM22.8588 22.0525C21.2428 22.0525 19.9112 20.5688 19.9112 18.7467C19.9112 16.9246 21.2169 15.4409 22.8588 15.4409C24.5136 15.4409 25.8323 16.9376 25.8064 18.7467C25.8064 20.5688 24.5136 22.0525 22.8588 22.0525Z" fill="currentColor"></path></svg></a></div></div><a class="pageNav_cloudLink__z77Wq" href="/_404.html"><svg fill="none" height="15" viewbox="0 0 25 15" width="25" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.5 15C3.18629 15 0.5 12.3137 0.5 9C0.5 5.68647 3.18599 3.0003 6.49945 3C7.86776 1.17833 10.0463 0 12.5 0C16.1293 0 19.1565 2.57787 19.8505 6.00244C19.9001 6.00082 19.95 6 20 6C22.4853 6 24.5 8.01472 24.5 10.5C24.5 12.9853 22.4853 15 20 15H12.5H6.5Z" fill="currentColor" fill-rule="evenodd"></path></svg><span>Sign in</span></a></div><div class="pageNav_navMenu__vU6m6"><svg fill="none" height="16" viewbox="0 0 20 16" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M2 2H18" stroke="currentColor" stroke-linecap="round" stroke-width="3"></path><path d="M2 8H18" stroke="currentColor" stroke-linecap="round" stroke-width="3"></path><path d="M2 14H18" stroke="currentColor" stroke-linecap="round" stroke-width="3"></path></svg></div></div></div><div class="webgl_webglWrapper__VMQ_x webgl_hideParticles__B1LPF"><div class="webgl_particles__uyNRX"></div><div class="webgl_particles__uyNRX webgl_particlesDark__zqjT3"></div><div class="backgroundFader_backgroundFader__HNJo8"><div class="globalPageWrapper"><div class="showcase_content__ZC_up"><div class="backgroundFader_backgroundBlock__t0XW3"><h1>Data modeling in Relvyn</h1><div class="showcase_intro__53zUD"><p>Most relational databases are fundamentally imperative: your schema exists as a running sequence of modification commands, usually scattered across a heap of migration scripts. Suffice it to say, that is far from a human-friendly way to describe a schema.</p><p>Hunting for friendlier modeling tools, developers often reach for ORM libraries or NoSQL stores, each of which arrives with its own set of tradeoffs.</p><p>Relvyn resolves this by shipping a first-party declarative schema modeling language that is woven deeply into Relvyn's query language, type system, and migration tools.</p></div></div><div class="backgroundFader_backgroundBlock__t0XW3"><section class="showcase_section__lPxS6"><h3>Modeling basics</h3><p>Schemas are built from object types—the counterpart to tables in SQL—that carry properties and links to other objects. Those "link" fields make foreign key constraints unnecessary.</p><div class="codeExplainer_codeExplainer__BpNaG showcase_codeExplainer__wDX8H"><div class="codeExplainer_header__O9GX6"><div class="codeExplainer_leftArrow__cfYda codeExplainer_inactive__cMH1F"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div><div class="codeExplainer_tabsWrapper__n6ZXi"><div class="codeExplainer_tabs__5zElu"><div class="codeExplainer_tab__5XHpH codeExplainer_selectedTab__pIv4f">Object types</div><div class="codeExplainer_tab__5XHpH">Abstract types</div><div class="codeExplainer_tab__5XHpH">Default values</div><div class="codeExplainer_tab__5XHpH">Computed properties</div><div class="codeExplainer_tab__5XHpH">Constraints</div><div class="codeExplainer_tab__5XHpH">Indexes</div></div></div><div class="codeExplainer_rightArrow__AvNd2"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div></div><div class="codeExplainer_codeBlock__uSYOH"><div class="codeExplainer_codeBlockInner__Y5_4j"><div class="code_code__f6VbY code-language-sdl codeExplainer_code__u4WEL" style="--maxLineLength:27;--code-max-height:12;--linenoLength:1"><div class="code_highlightWrapper__8YM2j code_hasCopyButton__vL2_6"><div class="code_copyCodeButtonWrapper__gi2zF"><div class="copyButton_copyButton__by6tt code_copyCode__EvySm copyButton_mobileMini__00ly5"><svg class="copyButton_icon__q3nOu" fill="none" height="15" viewbox="0 0 13 15" width="13" xmlns="http://www.w3.org/2000/svg"><rect height="11" rx="1.5" stroke="currentColor" width="9" x="3.5" y="3.5"></rect><rect fill="currentColor" height="12" rx="2" width="10"></rect></svg><span class="copyButton_label__QsK47">Copy</span></div></div><div class="code_block__73rl_" translate="no"><div><pre><span class="tokens tokens-normal"><span class="token keyword">type</span> User { | |
| <span class="token keyword">required</span> first_name: <span class="token builtin">str</span>; | |
| middle_name: <span class="token builtin">str</span>; | |
| } | |
| </span></pre></div></div></div></div><pre class="codeExplainer_explanation__kDdVm">No "id" property is required, as Relvyn automatically generates a unique ID for every object in the database.</pre></div></div></div></section><section class="showcase_section__lPxS6"><h3>Type system</h3><p>Relvyn's type system was engineered from the ground up for consistency and safety. Every value that Relvyn stores is strongly typed, no exceptions.</p><div class="codeExplainer_codeExplainer__BpNaG showcase_codeExplainer__wDX8H"><div class="codeExplainer_header__O9GX6"><div class="codeExplainer_leftArrow__cfYda codeExplainer_inactive__cMH1F"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div><div class="codeExplainer_tabsWrapper__n6ZXi"><div class="codeExplainer_tabs__5zElu"><div class="codeExplainer_tab__5XHpH codeExplainer_selectedTab__pIv4f">Scalar types</div><div class="codeExplainer_tab__5XHpH">Enums</div><div class="codeExplainer_tab__5XHpH">Arrays</div><div class="codeExplainer_tab__5XHpH">Tuples</div><div class="codeExplainer_tab__5XHpH">Custom scalars</div></div></div><div class="codeExplainer_rightArrow__AvNd2"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div></div><div class="codeExplainer_codeBlock__uSYOH"><div class="codeExplainer_codeBlockInner__Y5_4j"><div class="code_code__f6VbY code-language-sdl codeExplainer_code__u4WEL" style="--maxLineLength:19;--code-max-height:12;--linenoLength:2"><div class="code_highlightWrapper__8YM2j code_hasCopyButton__vL2_6"><div class="code_copyCodeButtonWrapper__gi2zF"><div class="copyButton_copyButton__by6tt code_copyCode__EvySm copyButton_mobileMini__00ly5"><svg class="copyButton_icon__q3nOu" fill="none" height="15" viewbox="0 0 13 15" width="13" xmlns="http://www.w3.org/2000/svg"><rect height="11" rx="1.5" stroke="currentColor" width="9" x="3.5" y="3.5"></rect><rect fill="currentColor" height="12" rx="2" width="10"></rect></svg><span class="copyButton_label__QsK47">Copy</span></div></div><div class="code_block__73rl_" translate="no"><div><pre><span class="tokens tokens-normal"><span class="token builtin">str</span> | |
| <span class="token builtin">bool</span> | |
| int{<span class="token number">16</span>|<span class="token number">32</span>|<span class="token number">64</span>} | |
| float{<span class="token number">32</span>|<span class="token number">64</span>} | |
| <span class="token builtin">bigint</span> | |
| <span class="token builtin">decimal</span> | |
| <span class="token builtin">sequence</span> | |
| <span class="token builtin">datetime</span> | |
| <span class="token builtin">duration</span> | |
| cal::<span class="token builtin">local_datetime</span> | |
| cal::<span class="token builtin">local_date</span> | |
| cal::<span class="token builtin">local_time</span> | |
| <span class="token builtin">uuid</span> | |
| <span class="token builtin">json</span> | |
| <span class="token builtin">enum</span><span class="token operator"><</span>X,Y,[...]<span class="token operator">></span> | |
| </span></pre></div></div></div></div><pre class="codeExplainer_explanation__kDdVm">These scalar types underpin Relvyn's type system, can be used as properties or composed into arrays and tuples. Read the Scalar docs for details, methods, and operators for each type.</pre></div></div></div></section><section class="showcase_section__lPxS6"><h3>Relations made simple</h3><p>Relvyn brings in the idea of "links" for connecting objects to one another directly, which removes any need for foreign key constraints.</p><div class="codeExplainer_codeExplainer__BpNaG showcase_codeExplainer__wDX8H"><div class="codeExplainer_header__O9GX6"><div class="codeExplainer_leftArrow__cfYda codeExplainer_inactive__cMH1F"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div><div class="codeExplainer_tabsWrapper__n6ZXi"><div class="codeExplainer_tabs__5zElu"><div class="codeExplainer_tab__5XHpH codeExplainer_selectedTab__pIv4f">One-to-many</div><div class="codeExplainer_tab__5XHpH">One-to-one</div><div class="codeExplainer_tab__5XHpH">Many-to-many</div><div class="codeExplainer_tab__5XHpH">Backward links</div></div></div><div class="codeExplainer_rightArrow__AvNd2"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div></div><div class="codeExplainer_codeBlock__uSYOH"><div class="codeExplainer_codeBlockInner__Y5_4j"><div class="code_code__f6VbY code-language-sdl codeExplainer_code__u4WEL" style="--maxLineLength:24;--code-max-height:12;--linenoLength:1"><div class="code_highlightWrapper__8YM2j code_hasCopyButton__vL2_6"><div class="code_copyCodeButtonWrapper__gi2zF"><div class="copyButton_copyButton__by6tt code_copyCode__EvySm copyButton_mobileMini__00ly5"><svg class="copyButton_icon__q3nOu" fill="none" height="15" viewbox="0 0 13 15" width="13" xmlns="http://www.w3.org/2000/svg"><rect height="11" rx="1.5" stroke="currentColor" width="9" x="3.5" y="3.5"></rect><rect fill="currentColor" height="12" rx="2" width="10"></rect></svg><span class="copyButton_label__QsK47">Copy</span></div></div><div class="code_block__73rl_" translate="no"><div><pre><span class="tokens tokens-normal"><span class="token keyword">type</span> User { | |
| <span class="token keyword">required</span> email: <span class="token builtin">str</span>; | |
| } | |
| <span class="token keyword">type</span> BlogPost { | |
| <span class="token keyword">required</span> content: <span class="token builtin">str</span>; | |
| <span class="token keyword">required</span> author: User; | |
| }</span></pre></div></div></div></div><pre class="codeExplainer_explanation__kDdVm">Modeling a one-to-many relation is simple and intuitive. Under the hood, a foreign key column referencing User will be added to the BlogPost table.</pre></div></div></div></section><section class="showcase_section__lPxS6"><h3>Advanced modeling</h3><p>Relvyn is no toy database. It sets out to match or exceed SQL in capability, expressiveness, consistency, and elegance.</p><div class="codeExplainer_codeExplainer__BpNaG showcase_codeExplainer__wDX8H"><div class="codeExplainer_header__O9GX6"><div class="codeExplainer_leftArrow__cfYda codeExplainer_inactive__cMH1F"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div><div class="codeExplainer_tabsWrapper__n6ZXi"><div class="codeExplainer_tabs__5zElu"><div class="codeExplainer_tab__5XHpH codeExplainer_selectedTab__pIv4f">Modules</div><div class="codeExplainer_tab__5XHpH">Custom functions</div><div class="codeExplainer_tab__5XHpH">Object-level constraints</div><div class="codeExplainer_tab__5XHpH">Polymorphic links</div><div class="codeExplainer_tab__5XHpH">Named expressions</div><div class="codeExplainer_tab__5XHpH">Unions</div><div class="codeExplainer_tab__5XHpH">Edge properties</div></div></div><div class="codeExplainer_rightArrow__AvNd2"><svg fill="none" height="31" viewbox="0 0 16 31" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.68858 15.145L15.3956 4.05133C16.284 3.03604 16.1811 1.49281 15.1658 0.604425C14.1505 -0.283957 12.6073 -0.181074 11.7189 0.834219L0.604391 13.5365C-0.201464 14.4575 -0.201464 15.8326 0.604391 16.7536L11.7189 29.4559C12.6073 30.4712 14.1505 30.574 15.1658 29.6857C16.1811 28.7973 16.284 27.254 15.3956 26.2387L5.68858 15.145Z" fill="currentColor"></path></svg></div></div><div class="codeExplainer_codeBlock__uSYOH"><div class="codeExplainer_codeBlockInner__Y5_4j"><div class="code_code__f6VbY code-language-sdl codeExplainer_code__u4WEL" style="--maxLineLength:23;--code-max-height:12;--linenoLength:2"><div class="code_highlightWrapper__8YM2j code_hasCopyButton__vL2_6"><div class="code_copyCodeButtonWrapper__gi2zF"><div class="copyButton_copyButton__by6tt code_copyCode__EvySm copyButton_mobileMini__00ly5"><svg class="copyButton_icon__q3nOu" fill="none" height="15" viewbox="0 0 13 15" width="13" xmlns="http://www.w3.org/2000/svg"><rect height="11" rx="1.5" stroke="currentColor" width="9" x="3.5" y="3.5"></rect><rect fill="currentColor" height="12" rx="2" width="10"></rect></svg><span class="copyButton_label__QsK47">Copy</span></div></div><div class="code_block__73rl_" translate="no"><div><pre><span class="tokens tokens-normal"><span class="token keyword">module</span> auth { | |
| <span class="token keyword">type</span> User { | |
| <span class="token comment"># properties...</span> | |
| }; | |
| } | |
| <span class="token keyword">module</span> models { | |
| <span class="token keyword">type</span> BlogPost { | |
| author: auth::User; | |
| }; | |
| }</span></pre></div></div></div></div><pre class="codeExplainer_explanation__kDdVm">Schemas can be split up into logical units called modules. | |
| You can choose whether to define your whole schema inside the "default" module or split it into several. If you split it up, use the "{module}::" namespace prefix when referencing the type in other modules.</pre></div></div></div></section></div><div class="backgroundFader_backgroundBlock__t0XW3"><section class="showcase_section__lPxS6"><h2>Explore further</h2><div class="learnCards_learnCards__aN5Ni"><a class="" href="/docs/guides/quickstart"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">5-minute Quickstart</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a><a class="" href="/tutorial"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">Interactive RelQL Tutorial</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a><a class="" href="/easy-relvyn"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">Easy Relvyn Book</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a><a class="" href="/docs"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">Documentation</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a><a class="" href="/showcase/migrations"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">Migrations</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a><a class="" href="/showcase/graphql"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">GraphQL</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a><a class="learnCards_skipColumn__nlLQZ" href="/showcase/edgeql"><div class="learnCards_cardContent__yWPIY"><span class="learnCards_cardTitle__uJx2A">RelQL</span><svg class="expandingArrow_expandingArrow__8bwqC" height="16" style="stroke-width:3px;--expandArrowBy:8" viewbox="-1.5 -1.5 38 16" width="38" xmlns="http://www.w3.org/2000/svg"><path d="M 0 6.5 H 26"></path><path class="expandingArrow_arrowLine__bPw85" d="M 25 6.5 h 2" style="transform-origin:25px"></path><path class="expandingArrow_arrowHead__EpVbj" d="M 20.5 0 l 6.5 6.5 l -6.5 6.5"></path></svg><div class="learnCards_cardBackground__7BZzt"></div></div><div class="learnCards_cardGradient__AhoXi"></div></a></div></section></div></div></div></div></div><footer class="pageFooter_pageFooter__W51QO showcase_pageFooter__DzWWH"><div data-theme="dark" style="max-width:100%"><div class="pageFooter_footerContent__sXQCm"><div class="pageFooter_footerContent__tzWqG"><div class="pageFooter_linksGrid__4YMSV pageFooter_footerLinks__Lzh46"><div class="pageFooter_linksGroup__4T9R4"><div class="pageFooter_heading__Su_Zl">Product</div><a href="/">Home</a><a href="/cloud">Cloud</a><a href="/pricing">Pricing</a><a href="/_404.html">Cloud Status</a></div><div class="pageFooter_linksGroup__4T9R4"><div class="pageFooter_heading__Su_Zl">Resources</div><a href="/p/quickstart-docs">Quickstart</a><a href="/_404.html">Documentation</a><a href="/_404.html">Community Channel</a></div><div class="pageFooter_linksGroup__4T9R4"><div class="pageFooter_heading__Su_Zl">Company</div><a href="/about">About</a><a href="/terms-of-use">Terms of Use</a><a href="/privacy-policy">Privacy Policy</a><a href="/cloud-terms-and-conditions">Cloud Terms and Conditions</a></div></div><div class="pageFooter_subscribe__Q1zVi"><div class="pageFooter_heading__Su_Zl">Newsletter</div><div class="pageFooter_subscribeInput__T96Oc"><form novalidate=""><input placeholder="Enter your email" required="" type="email"/><button type="submit">Subscribe</button></form></div><div class="pageFooter_message__JYO9h">Join our mailing list and be among the first to hear about fresh blog posts and product news.</div><div class="pageFooter_rssLink__j6XNX"><a href="/rss.xml">RSS</a></div></div></div><div class="pageFooter_copyright__PhYtL"><a href="/_404.html"><svg fill="none" height="24" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M13.7142 10.6226L20.4162 3H18.8286L13.0068 9.61726L8.3604 3H3L10.0278 13.0074L3 20.9999H4.5876L10.7316 14.0104L15.6396 20.9999H21M5.1606 4.17142H7.5996L18.8274 19.8861H16.3878" fill="currentColor"></path></svg></a><a href="/_cdn/github.com/geldata"><svg height="35" viewbox="0 0 35 35" width="35"><path d="M17.5 3.5 L20.6 14.4 L31.5 17.5 L20.6 20.6 L17.5 31.5 L14.4 20.6 L3.5 17.5 L14.4 14.4 Z" fill-rule="evenodd"></path></svg></a><a href="/_404.html"><svg fill="none" height="35" viewbox="0 0 35 35" width="35" xmlns="http://www.w3.org/2000/svg"><path d="M28.7657 7.07236C26.6752 6.11316 24.4334 5.40646 22.0896 5.0017C22.0469 4.99389 22.0042 5.01341 21.9823 5.05245C21.694 5.56523 21.3746 6.23419 21.151 6.75999C18.63 6.38257 16.1219 6.38257 13.6526 6.75999C13.4289 6.2225 13.098 5.56523 12.8084 5.05245C12.7864 5.01471 12.7438 4.99519 12.7011 5.0017C10.3585 5.40516 8.11677 6.11186 6.02498 7.07236C6.00687 7.08017 5.99135 7.0932 5.98105 7.11011C1.72894 13.4627 0.564116 19.6591 1.13554 25.7787C1.13813 25.8086 1.15493 25.8372 1.1782 25.8554C3.98362 27.9157 6.70115 29.1664 9.36821 29.9954C9.41089 30.0085 9.45612 29.9929 9.48328 29.9577C10.1142 29.0962 10.6766 28.1877 11.1588 27.2324C11.1872 27.1764 11.16 27.1101 11.1019 27.0879C10.2098 26.7496 9.36045 26.337 8.54338 25.8685C8.47876 25.8307 8.47358 25.7383 8.53304 25.694C8.70498 25.5652 8.87696 25.4311 9.04114 25.2958C9.07085 25.2711 9.11224 25.2658 9.14716 25.2815C14.5149 27.7322 20.3261 27.7322 25.6306 25.2815C25.6655 25.2645 25.7069 25.2698 25.7379 25.2945C25.9021 25.4298 26.074 25.5652 26.2473 25.694C26.3067 25.7383 26.3029 25.8307 26.2382 25.8685C25.4212 26.3461 24.5718 26.7496 23.6784 27.0866C23.6203 27.1088 23.5944 27.1764 23.6229 27.2324C24.1154 28.1864 24.6778 29.0948 25.297 29.9564C25.3229 29.9929 25.3694 30.0085 25.4121 29.9954C28.0921 29.1664 30.8096 27.9157 33.615 25.8554C33.6396 25.8372 33.6551 25.8099 33.6577 25.7799C34.3416 18.705 32.5122 12.5594 28.8083 7.1114C28.7993 7.0932 28.7838 7.08017 28.7657 7.07236ZM11.9603 22.0525C10.3443 22.0525 9.01269 20.5688 9.01269 18.7467C9.01269 16.9246 10.3185 15.4409 11.9603 15.4409C13.6151 15.4409 14.9338 16.9376 14.9079 18.7467C14.9079 20.5688 13.6022 22.0525 11.9603 22.0525ZM22.8588 22.0525C21.2428 22.0525 19.9112 20.5688 19.9112 18.7467C19.9112 16.9246 21.2169 15.4409 22.8588 15.4409C24.5136 15.4409 25.8323 16.9376 25.8064 18.7467C25.8064 20.5688 24.5136 22.0525 22.8588 22.0525Z"></path></svg></a><a href="/_404.html"><svg height="35" viewbox="0 0 16 16" width="35" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M15.32 4.06c-.434-.772-.905-.914-1.864-.968C12.498 3.027 10.089 3 8.002 3c-2.091 0-4.501.027-5.458.091-.957.055-1.429.196-1.867.969C.23 4.831 0 6.159 0 8.497v.008c0 2.328.23 3.666.677 4.429.438.772.909.912 1.866.977.958.056 3.368.089 5.459.089 2.087 0 4.496-.033 5.455-.088.959-.065 1.43-.205 1.864-.977.451-.763.679-2.101.679-4.429v-.008c0-2.339-.228-3.667-.68-4.438zM6 11.5v-6l5 3-5 3z" fill-rule="evenodd"></path></svg></a><p class="pageFooter_label__3dLTH">© 2025, Relvyn, Inc. All rights reserved.</p></div></div></div></footer></div><div id="themeSwitcherPortalTarget"></div><div id="overlayPortalTarget"></div></div></div><script src="/cr-site.js"></script> | |
| </body></html> |