Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support user-defined functions (UDFs) #54

Open
clue opened this issue Dec 20, 2021 · 0 comments
Open

Support user-defined functions (UDFs) #54

clue opened this issue Dec 20, 2021 · 0 comments
Labels
help wanted Extra attention is needed new feature New feature or request

Comments

@clue
Copy link
Owner

clue commented Dec 20, 2021

$db = new Clue\React\Sqlite\SqliteClient(':memory:');

$db->on('open', function () use ($db) {
    $db->createFunction('hash', 'sha1', 1);
});

$db->query('SELECT hash("foo")')->then('var_dump');

See https://www.php.net/manual/en/sqlite3.createfunction.php
Refs #47

@clue clue added new feature New feature or request help wanted Extra attention is needed labels Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed new feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant