Skip to content

Commit 8cd8d13

Browse files
authored
Small readme edits (#30)
Plus clarified a sentence in the template README.
1 parent d67ba7a commit 8cd8d13

19 files changed

+2261
-902
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
## Why Zig?
1818

19-
[Zig](https://ziglang.org/) is a small and simple language that aims to be a "modern C" and make system-level code bases easier to maintain. It provides safe memory management, compilation time code execution (comptime), and a standard library.
19+
[Zig](https://ziglang.org/) is a small and simple language that aims to be a "modern C" and make system-level code bases easier to maintain. It provides safe memory management, compilation time code execution (comptime), and a rich standard library.
2020

2121
Zig can interact with C code quite naturally: it supports the C ABI, can work with C pointers and types directly, it can import header files and even translate C code to Zig code. Thanks to this interoperability, a Postgres extension written in Zig can, theoretically, accomplish anything that a C extension can. This means you get full power AND a modern language and standard library to write your extension.
2222

@@ -185,6 +185,7 @@ pgzx is currently under heavy development by the [Xata](https://xata.io) team. I
185185
* [ ] Postgres 14
186186
* [ ] Postgres 15
187187
* [ ] Postgres 16
188+
* [x] Postgres 17
188189
* [x] Logging
189190
* [x] Error handling
190191
* [x] Memory context allocators
@@ -203,7 +204,7 @@ pgzx is currently under heavy development by the [Xata](https://xata.io) team. I
203204
* ...
204205
* [ ] Single list
205206
* [ ] Double list
206-
* [ ] Hash tables
207+
* [x] Hash tables
207208
* Development environment
208209
* [ ] Download and vendor Postgres source code
209210
* [x] Compile example extensions against the Postgres source code
@@ -456,6 +457,7 @@ This step will take a while. You will find the compiler and library of your loca
456457
## See also
457458

458459
* [pgrx](https://github.com/pgcentralfoundation/pgrx) - Similar project but for Rust, it served as an inspiration for this project.
460+
* [pg_tle](https://github.com/aws/pg_tle) - Trusted Language Extensions for PostgreSQL.
459461

460462
## License
461463

docs/data-astNodes.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-calls.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-comptimeExprs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-decls.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-exprs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-files.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-modules.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/data-types.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/builtin/builtin.zig.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<span class="line" id="L2"><span class="tok-comment">/// Zig version. When writing code that supports multiple versions of Zig, prefer</span></span>
117117
<span class="line" id="L3"><span class="tok-comment">/// feature detection (i.e. with `@hasDecl` or `@hasField`) over version checks.</span></span>
118118
<span class="line" id="L4"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> zig_version = std.SemanticVersion.parse(zig_version_string) <span class="tok-kw">catch</span> <span class="tok-kw">unreachable</span>;</span>
119-
<span class="line" id="L5"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> zig_version_string = <span class="tok-str">&quot;0.12.0-dev.2819+65a87ff29&quot;</span>;</span>
119+
<span class="line" id="L5"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> zig_version_string = <span class="tok-str">&quot;0.12.0-dev.3154+0b744da84&quot;</span>;</span>
120120
<span class="line" id="L6"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> zig_backend = std.builtin.CompilerBackend.stage2_llvm;</span>
121121
<span class="line" id="L7"></span>
122122
<span class="line" id="L8"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> output_mode = std.builtin.OutputMode.Exe;</span>

docs/src/pgzx/pgzx.zig.html

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,23 @@
140140
<span class="line" id="L23"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> str = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/str.zig&quot;</span>);</span>
141141
<span class="line" id="L24"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> utils = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/utils.zig&quot;</span>);</span>
142142
<span class="line" id="L25"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> intr = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/interrupts.zig&quot;</span>);</span>
143-
<span class="line" id="L26"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> list = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/list.zig&quot;</span>);</span>
144-
<span class="line" id="L27"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> testing = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/testing.zig&quot;</span>);</span>
145-
<span class="line" id="L28"></span>
146-
<span class="line" id="L29"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> guc = utils.guc;</span>
143+
<span class="line" id="L26"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> testing = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/testing.zig&quot;</span>);</span>
144+
<span class="line" id="L27"></span>
145+
<span class="line" id="L28"><span class="tok-comment">// data structures</span>
146+
</span>
147+
<span class="line" id="L29"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> collections = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;pgzx/collections.zig&quot;</span>);</span>
147148
<span class="line" id="L30"></span>
148-
<span class="line" id="L31"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PGError = err.PGError;</span>
149-
<span class="line" id="L32"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> pgRethrow = err.pgRethrow;</span>
150-
<span class="line" id="L33"></span>
151-
<span class="line" id="L34"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PG_MODULE_MAGIC = fmgr.PG_MODULE_MAGIC;</span>
152-
<span class="line" id="L35"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PG_FUNCTION_V1 = fmgr.PG_FUNCTION_V1;</span>
153-
<span class="line" id="L36"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PG_FUNCTION_INFO_V1 = fmgr.PG_FUNCTION_INFO_V1;</span>
154-
<span class="line" id="L37"></span>
155-
<span class="line" id="L38"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PointerListOf = list.PointerListOf;</span>
149+
<span class="line" id="L31"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> guc = utils.guc;</span>
150+
<span class="line" id="L32"></span>
151+
<span class="line" id="L33"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PGError = err.PGError;</span>
152+
<span class="line" id="L34"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> pgRethrow = err.pgRethrow;</span>
153+
<span class="line" id="L35"></span>
154+
<span class="line" id="L36"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PG_MODULE_MAGIC = fmgr.PG_MODULE_MAGIC;</span>
155+
<span class="line" id="L37"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PG_FUNCTION_V1 = fmgr.PG_FUNCTION_V1;</span>
156+
<span class="line" id="L38"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PG_FUNCTION_INFO_V1 = fmgr.PG_FUNCTION_INFO_V1;</span>
156157
<span class="line" id="L39"></span>
158+
<span class="line" id="L40"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> list = collections.list;</span>
159+
<span class="line" id="L41"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> PointerListOf = list.PointerListOf;</span>
160+
<span class="line" id="L42"></span>
157161
</code></pre></body>
158162
</html>

docs/src/pgzx/pgzx/c.zig.html

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,30 +133,32 @@
133133
<span class="line" id="L19"></span>
134134
<span class="line" id="L20"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;commands/extension.h&quot;</span>);</span>
135135
<span class="line" id="L21"></span>
136-
<span class="line" id="L22"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;storage/ipc.h&quot;</span>);</span>
137-
<span class="line" id="L23"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;storage/proc.h&quot;</span>);</span>
138-
<span class="line" id="L24"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;storage/latch.h&quot;</span>);</span>
139-
<span class="line" id="L25"></span>
140-
<span class="line" id="L26"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/builtins.h&quot;</span>);</span>
141-
<span class="line" id="L27"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/datum.h&quot;</span>);</span>
142-
<span class="line" id="L28"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/guc.h&quot;</span>);</span>
143-
<span class="line" id="L29"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/guc_hooks.h&quot;</span>);</span>
144-
<span class="line" id="L30"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/guc_tables.h&quot;</span>);</span>
145-
<span class="line" id="L31"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/memutils.h&quot;</span>);</span>
146-
<span class="line" id="L32"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/wait_event.h&quot;</span>);</span>
147-
<span class="line" id="L33"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/jsonb.h&quot;</span>);</span>
148-
<span class="line" id="L34"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/lsyscache.h&quot;</span>);</span>
149-
<span class="line" id="L35"></span>
150-
<span class="line" id="L36"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;access/xact.h&quot;</span>);</span>
136+
<span class="line" id="L22"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;lib/ilist.h&quot;</span>);</span>
137+
<span class="line" id="L23"></span>
138+
<span class="line" id="L24"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;storage/ipc.h&quot;</span>);</span>
139+
<span class="line" id="L25"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;storage/proc.h&quot;</span>);</span>
140+
<span class="line" id="L26"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;storage/latch.h&quot;</span>);</span>
141+
<span class="line" id="L27"></span>
142+
<span class="line" id="L28"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/builtins.h&quot;</span>);</span>
143+
<span class="line" id="L29"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/datum.h&quot;</span>);</span>
144+
<span class="line" id="L30"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/guc.h&quot;</span>);</span>
145+
<span class="line" id="L31"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/guc_hooks.h&quot;</span>);</span>
146+
<span class="line" id="L32"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/guc_tables.h&quot;</span>);</span>
147+
<span class="line" id="L33"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/memutils.h&quot;</span>);</span>
148+
<span class="line" id="L34"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/wait_event.h&quot;</span>);</span>
149+
<span class="line" id="L35"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/jsonb.h&quot;</span>);</span>
150+
<span class="line" id="L36"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;utils/lsyscache.h&quot;</span>);</span>
151151
<span class="line" id="L37"></span>
152-
<span class="line" id="L38"> <span class="tok-comment">// libpq support</span>
152+
<span class="line" id="L38"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;access/xact.h&quot;</span>);</span>
153+
<span class="line" id="L39"></span>
154+
<span class="line" id="L40"> <span class="tok-comment">// libpq support</span>
153155
</span>
154-
<span class="line" id="L39"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;libpq-fe.h&quot;</span>);</span>
155-
<span class="line" id="L40"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;libpq/libpq-be.h&quot;</span>);</span>
156-
<span class="line" id="L41"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;libpqsrv.h&quot;</span>);</span>
157-
<span class="line" id="L42">});</span>
158-
<span class="line" id="L43"></span>
159-
<span class="line" id="L44"><span class="tok-kw">pub</span> <span class="tok-kw">usingnamespace</span> includes;</span>
156+
<span class="line" id="L41"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;libpq-fe.h&quot;</span>);</span>
157+
<span class="line" id="L42"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;libpq/libpq-be.h&quot;</span>);</span>
158+
<span class="line" id="L43"> <span class="tok-builtin">@cInclude</span>(<span class="tok-str">&quot;libpqsrv.h&quot;</span>);</span>
159+
<span class="line" id="L44">});</span>
160160
<span class="line" id="L45"></span>
161+
<span class="line" id="L46"><span class="tok-kw">pub</span> <span class="tok-kw">usingnamespace</span> includes;</span>
162+
<span class="line" id="L47"></span>
161163
</code></pre></body>
162164
</html>
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>pgzx/collections.zig - source view</title>
6+
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxD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LDk1IDEzMSw5NSAxMzEsNDUgMTIyLDQ1IDEzMiwzNiAxNDEsMjIiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIvPjxwb2x5Z29uIHBvaW50cz0iMTI1LDk1IDEzMCwxMTAgMTA2LDExNyIvPjwvZz48L2c+PC9zdmc+">
8+
<style>
9+
body{
10+
font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
11+
margin: 0;
12+
line-height: 1.5;
13+
}
14+
15+
pre > code {
16+
display: block;
17+
overflow: auto;
18+
line-height: normal;
19+
margin: 0em;
20+
}
21+
.tok-kw {
22+
color: #333;
23+
font-weight: bold;
24+
}
25+
.tok-str {
26+
color: #d14;
27+
}
28+
.tok-builtin {
29+
color: #005C7A;
30+
}
31+
.tok-comment {
32+
color: #545454;
33+
font-style: italic;
34+
}
35+
.tok-fn {
36+
color: #900;
37+
font-weight: bold;
38+
}
39+
.tok-null {
40+
color: #005C5C;
41+
}
42+
.tok-number {
43+
color: #005C5C;
44+
}
45+
.tok-type {
46+
color: #458;
47+
font-weight: bold;
48+
}
49+
pre {
50+
counter-reset: line;
51+
}
52+
pre .line:before {
53+
counter-increment: line;
54+
content: counter(line);
55+
display: inline-block;
56+
padding-right: 1em;
57+
width: 2em;
58+
text-align: right;
59+
color: #999;
60+
}
61+
62+
.line {
63+
width: 100%;
64+
display: inline-block;
65+
}
66+
.line:target {
67+
border-top: 1px solid #ccc;
68+
border-bottom: 1px solid #ccc;
69+
background: #fafafa;
70+
}
71+
72+
@media (prefers-color-scheme: dark) {
73+
body{
74+
background:#222;
75+
color: #ccc;
76+
}
77+
pre > code {
78+
color: #ccc;
79+
background: #222;
80+
border: unset;
81+
}
82+
.line:target {
83+
border-top: 1px solid #444;
84+
border-bottom: 1px solid #444;
85+
background: #333;
86+
}
87+
.tok-kw {
88+
color: #eee;
89+
}
90+
.tok-str {
91+
color: #2e5;
92+
}
93+
.tok-builtin {
94+
color: #ff894c;
95+
}
96+
.tok-comment {
97+
color: #aa7;
98+
}
99+
.tok-fn {
100+
color: #B1A0F8;
101+
}
102+
.tok-null {
103+
color: #ff8080;
104+
}
105+
.tok-number {
106+
color: #ff8080;
107+
}
108+
.tok-type {
109+
color: #68f;
110+
}
111+
}
112+
</style>
113+
</head>
114+
<body>
115+
<pre><code><span class="line" id="L1"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> list = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;collections/list.zig&quot;</span>);</span>
116+
<span class="line" id="L2"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> slist = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;collections/slist.zig&quot;</span>);</span>
117+
<span class="line" id="L3"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> dlist = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;collections/dlist.zig&quot;</span>);</span>
118+
<span class="line" id="L4"></span>
119+
</code></pre></body>
120+
</html>

0 commit comments

Comments
 (0)