[API reference](https://evolu.dev/docs/api-reference) › [@evolu/sqlite-wasm](https://evolu.dev/docs/api-reference/sqlite-wasm) › [c-api](https://evolu.dev/docs/api-reference/sqlite-wasm/c-api) › sqlite3\_collation\_needed

```ts
function sqlite3_collation_needed(
  deps: SqliteWasmDep,
): (
  db: SqliteDbPtr,
  pArg: 0 | WasmPtr,
  xCollNeeded: 0 | SqliteFunctionPtr,
) => SqliteResultCode;
```

Defined in: [packages/sqlite-wasm/src/CApi.ts:1790](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/sqlite-wasm/src/CApi.ts#L1790)

Sets the connection's callback for an undefined collation sequence, replacing
the previous one. SQLite calls it with pArg, the connection, the preferred
text encoding and the UTF-8 collation name, and the callback should register
that collation.

Wasm type `i(iii)`. Signature `["sqlite3_collation_needed", "int",
"sqlite3*", "*", "*"]` from SQLite's table.

See https://sqlite.org/c3ref/collation_needed.html.