You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-18Lines changed: 38 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,14 @@
1
-
# [Example WASI proposal]
2
-
3
-
This template can be used to start a new proposal, which can then be proposed in the WASI Subgroup meetings.
4
-
5
-
The sections below are recommended. However, every proposal is different, and the community can help you flesh out the proposal, so don't block on having something filled in for each one of them.
6
-
7
-
Thank you to the W3C Privacy CG for the [inspiration](https://github.com/privacycg/template)!
8
-
9
-
# [Title]
1
+
# WASI SQL Embedding
10
2
11
3
A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) API.
12
4
13
5
### Current Phase
14
6
15
-
[Fill in the current phase, e.g. Phase 1]
7
+
WASI SQL Embedding is currently in [Phase 1](https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-1---feature-proposal-cg).
16
8
17
9
### Champions
18
10
19
-
-[Champion 1]
20
-
-[Champion 2]
21
-
-[etc.]
11
+
- Kyle Brown
22
12
23
13
### Phase 4 Advancement Criteria
24
14
@@ -43,11 +33,20 @@ TODO before entering Phase 2.
43
33
44
34
### Introduction
45
35
46
-
[The "executive summary" or "abstract". Explain in a few sentences what the goals of the project are, and a brief overview of how the solution works. This should be no more than 1-2 paragraphs.]
36
+
WASI SQL Embedding defines a way for WASM components to be embedded in SQL databases as extensions.
37
+
It defines the interfaces for various user objects (like User-Defined Functions a.k.a. UDFs) that can be exported by extensions and called from the database, the way component value types and SQL column types are mapped, and the facilities user objects are allowed to access/use.
38
+
39
+
WASI SQL Embedding abstracts over different SQL dialects and their types.
40
+
Extensions may either explicitly call out the SQL types of their arguments and results or allow them to be inferred.
41
+
If an Extension refers to a SQL type that is not supported by a given dialect, the embedder may decide to infer a type that they do support.
42
+
43
+
WASI SQL Embedding extension components will have some limited access to capabilities like random number generation,
44
+
but not any capabilities that access the file system or network.
45
+
Code that relies on the network or file-system should satisfy those requirements using virtualizations.
47
46
48
-
### Goals[or Motivating Use Cases, or Scenarios]
47
+
### Goals
49
48
50
-
[What is the end-user need which this project aims to address?]
49
+
The primary goal of WASI SQL Embedding is to enable users to define Wasm-based SQL Extensions in a standard way.
51
50
52
51
### Non-goals
53
52
@@ -59,9 +58,30 @@ The full API documentation can be found [here](wasi-proposal-template.md).
59
58
60
59
[Walk through of how someone would use this API.]
61
60
62
-
#### [Use case 1]
61
+
#### Unicode Functionality
63
62
64
-
[Provide example code snippets and diagrams explaining how the API would be used to solve the given problem]
63
+
If a user wanted to perform unicode normalization on some text in a database,
64
+
it would be convenient if they could write a simple extension that takes advantage of existing libraries.
65
+
66
+
e.g.
67
+
```rust
68
+
useunicode_normalization::UnicodeNormalization;
69
+
70
+
fnnormalize(input:String) ->String {
71
+
input.nfc().collect::<String>()
72
+
}
73
+
```
74
+
> **Note**
75
+
> Bindings-related code and configuration is omitted
76
+
77
+
After compiling this using WIT-based tooling, they would end up with a fully self-describing database extension.
78
+
79
+
They could load this into a database and normalize user names like so.
0 commit comments