Skip to content

Commit e0a05da

Browse files
authored
Merge pull request #1 from WebAssembly/initial-readme
Initial README content
2 parents 92a1f79 + 8b7bec9 commit e0a05da

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

README.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff 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
102

113
A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) API.
124

135
### Current Phase
146

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).
168

179
### Champions
1810

19-
- [Champion 1]
20-
- [Champion 2]
21-
- [etc.]
11+
- Kyle Brown
2212

2313
### Phase 4 Advancement Criteria
2414

@@ -43,11 +33,20 @@ TODO before entering Phase 2.
4333

4434
### Introduction
4535

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.
4746

48-
### Goals [or Motivating Use Cases, or Scenarios]
47+
### Goals
4948

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.
5150

5251
### Non-goals
5352

@@ -59,9 +58,30 @@ The full API documentation can be found [here](wasi-proposal-template.md).
5958

6059
[Walk through of how someone would use this API.]
6160

62-
#### [Use case 1]
61+
#### Unicode Functionality
6362

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+
use unicode_normalization::UnicodeNormalization;
69+
70+
fn normalize(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.
80+
```sql
81+
CREATE EXTENSION unicode FROM "https://...";
82+
...
83+
SELECT unicode_normalize(name) FROM users;
84+
```
6585

6686
#### [Use case 2]
6787

0 commit comments

Comments
 (0)