/ Docs
7.0
/
Table of Contents

SQL scripts

Put your *.sql scripts to dipdup_indexer/sql. You can run these scripts from any callback with ctx.execute_sql('name'). If name is a directory, each script it contains will be executed.

Scripts are executed without being wrapped with SQL transactions. It's generally a good idea to avoid touching table data in scripts.

By default, an empty sql/<hook_name> directory is generated for every hook in config during init. Remove ctx.execute_sql call from hook callback to avoid executing them.

Usage

# Execute all scripts in sql/my_hook directory
await ctx.execute_sql('my_hook')
# Execute a single script
await ctx.execute_sql('my_hook/my_script.sql')
Help and tips -> Join our Discord
Ideas or suggestions -> Issue Tracker
Table of Contents