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
+36-16Lines changed: 36 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,29 +183,49 @@ const result = parseQueryDetailedSync('SELECT * FROM users WHERE active = true')
183
183
// Returns: DetailedParseResult with enhanced error information if parsing fails
184
184
```
185
185
186
-
### `isReady(): boolean`
186
+
### Initialization
187
187
188
-
Checks if the WebAssembly module is initialized and ready for synchronous operations. This is only needed when using the synchronous methods (`parseQuerySync`, `deparseSync`, etc.).
188
+
The library provides both async and sync methods. Async methods handle initialization automatically, while sync methods require explicit initialization.
189
+
190
+
#### Async Methods (Recommended)
191
+
192
+
Async methods handle initialization automatically and are always safe to use:
const result =parseQuerySync('SELECT * FROM users');
206
226
```
207
227
208
-
Note: The async methods (`parseQuery`, `deparse`, `parsePlPgSQL`, etc.) handle initialization automatically and are always safe to use. The `isReady()`check is only needed for the synchronous versions of these methods.
228
+
Note: We recommend using async methods as they handle initialization automatically. Use sync methods only when necessary, and always call `loadModule()`first.
0 commit comments