All Projects → bluejekyll → Pg Extend Rs

bluejekyll / Pg Extend Rs

Licence: other
Postgres extension library for Rust

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Pg Extend Rs

Create Aio App
The boilerplate for aiohttp. Quick setup for your asynchronous web service.
Stars: ✭ 207 (-18.18%)
Mutual labels:  postgres
Sqliterally
Lightweight SQL query builder
Stars: ✭ 231 (-8.7%)
Mutual labels:  postgres
Rpostgres
A DBI-compliant interface to PostgreSQL
Stars: ✭ 245 (-3.16%)
Mutual labels:  postgres
Splitgraph
Splitgraph command line client and python library
Stars: ✭ 209 (-17.39%)
Mutual labels:  postgres
Fluentmigrator
Fluent migrations framework for .NET
Stars: ✭ 2,636 (+941.9%)
Mutual labels:  postgres
Massive Js
A data mapper for Node.js and PostgreSQL.
Stars: ✭ 2,521 (+896.44%)
Mutual labels:  postgres
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+815.02%)
Mutual labels:  postgres
Pg similarity
set of functions and operators for executing similarity queries
Stars: ✭ 250 (-1.19%)
Mutual labels:  postgres
Activerecord Postgres enum
Integrate PostgreSQL's enum data type into ActiveRecord's schema and migrations.
Stars: ✭ 227 (-10.28%)
Mutual labels:  postgres
Sql Lint
An SQL linter
Stars: ✭ 243 (-3.95%)
Mutual labels:  postgres
Stator
Stator, your go-to template for the perfect stack. 😍🙏
Stars: ✭ 217 (-14.23%)
Mutual labels:  postgres
Clear
Advanced ORM between postgreSQL and Crystal
Stars: ✭ 220 (-13.04%)
Mutual labels:  postgres
Opencollective Api
Open Collective's API. A GraphQL API powered by Sequelize and PostgreSQL.
Stars: ✭ 233 (-7.91%)
Mutual labels:  postgres
Spring Boot Postgresql Jpa Hibernate Rest Api Demo
Building RESTful APIs with Spring Boot, PostgreSQL, JPA and Hibernate
Stars: ✭ 209 (-17.39%)
Mutual labels:  postgres
Scenic
Scenic is maintained by Derek Prior, Caleb Hearth, and you, our contributors.
Stars: ✭ 2,856 (+1028.85%)
Mutual labels:  postgres
Postgres
🐘 Run PostgreSQL in Kubernetes
Stars: ✭ 205 (-18.97%)
Mutual labels:  postgres
Chameleon
Customizable honeypots for monitoring network traffic, bots activities and username\password credentials (DNS, HTTP Proxy, HTTP, HTTPS, SSH, POP3, IMAP, STMP, RDP, VNC, SMB, SOCKS5, Redis, TELNET, Postgres and MySQL)
Stars: ✭ 230 (-9.09%)
Mutual labels:  postgres
Flask Boilerplate
Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
Stars: ✭ 251 (-0.79%)
Mutual labels:  postgres
Wasmer Postgres
💽🕸 Postgres library to run WebAssembly binaries.
Stars: ✭ 245 (-3.16%)
Mutual labels:  postgres
Prest
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new
Stars: ✭ 3,023 (+1094.86%)
Mutual labels:  postgres

Build Status License: MIT License: Apache 2.0 Dependabot Status Discord

Rust based Postgres extension

The main things provided by this crate are some macros that help with writing Postgres extensions in Rust.

The objective (not all these are yet implemented):

  • Automatic type conversions, see PgDatum and TryFromPgDatum to Into<PgDatum>
  • pg_magic macro for declaring libraries as Postgres extensions
  • pg_extern attribute for wrapping Rust functions in Postgres C style definitions
  • panic handlers for conversion into Postgres errors
  • allocator that uses Postgres palloc allocator and pfree
  • tbd integrate postgres error logs with log
  • tbd support all Datum types
  • tbd support table like returns and manipulation
  • tbd generators for the psql scripts to load functions

Getting started

This project uses cargo-make for automation. While not necessary, it does help with a lot of the build tasks, so is recommended. This can be installed with cargo install cargo-make.

Once installed, it will install Postgres into the target directory for testing. There are profiles for each supported Postgres version, v10, v11, and v12. The specific minor version used is in

To run all tests with all features, for example, run:

> cargo make all-features -p v12 # if -p is left off, then the default is v12

Building

If using cargo-make then the environment variable PG_DIR can be used to specify the location of the Postgres install.

First install Postgres. The build should be able to find the directory for the Postgres server headers, it uses the pg_config --includedir-server to attempt to find the directory. If it is unsuccessful then this environment variable is required:

PG_INCLUDE_PATH=[/path/to/postgres]/include/server # e.g. /usr/local/pgsql/include/server

For the dynamic library to compile, your project should also have .cargo/config file with content:

[target.'cfg(unix)']
rustflags = "-C link-arg=-undefineddynamic_lookup"

[target.'cfg(windows)']
rustflags = "-C link-arg=/FORCE"

This informs the linker that some of the symbols for Postgres won't be available until runtime on the dynamic library load.

Running the integration tests

Standard tests can be run with the normal cargo test, but the integration tests are a little more involved. They require a connection to an actual Postgres DB. These instructions were performed on macOS. Create a DB in Postgres to be use. In this example a DB was created in the /usr/local/var/posgres path, with the name postgres. When using cargo-make all the automation of starting, installing and setting up the DB is handled for you:

Test all features:

> cargo make all-features

Test default features:

> cargo make default-features

Test no-default-features:

> cargo make no-default-features

Testing against different versions; v10, v11, v12 are valid:

> cargo make all-features -p v10

Without cargo-make

To run the test must know the DB name to use, the DB must be running, and then the tests can be run:

export POSTGRES_TEST_DB=postgres

pg_ctl -D /usr/local/var/postgres start
cargo test

Examples

Features

TBD

Community

For live discussions beyond this repository, please see this Discord.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].