deno_postgres_interop 0.0.4 copy "deno_postgres_interop: ^0.0.4" to clipboard
deno_postgres_interop: ^0.0.4 copied to clipboard

Platformweb

An interop for js package deno-postgres - PostgreSQL driver that can be used in deno-deploy (supabase edge functions).

deno_postgres_interop #

style: solid $solid_lints

The package allows the use of Deno Postgres in Deno Deploy on dart_edge by creating interop bindings for the js library since other drivers rely on dart:io and don't work there.

The main scenario is Supabase Edge Functions, but it should also work for other cases with dart2js.

Usage with Supabase edge functions #

  1. Add dependency in your pubspec.yaml:

    dependencies:
      deno_postgres_interop: <INSERT LATEST VERSION>
    

    or run

    dart pub add deno_postgres_interop
    
  2. Import the package:

    import 'package:deno_postgres_interop/deno_postgres_interop.dart';
    
  3. Compile the code that uses this package with:

    dart run edge build supabase_functions
    
  4. Add imports to generated file by calling the script:

    dart run deno_postgres_interop:add_imports \
      --filename=example/functions/dart_edge/main.dart.js
    

    Note: your filename may differ from the example

  5. You can use the function now.

Note that because of the bug in dart_edge, SDK versions >= 3.1.0 are not actually supported.

10
likes
150
pub points
55%
popularity

Publisher

verified publishersolid.software

An interop for js package deno-postgres - PostgreSQL driver that can be used in deno-deploy (supabase edge functions).

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

args, collection, yaml

More

Packages that depend on deno_postgres_interop