使用 Rust 开发 PostgreSQL 扩展函数 pgxr

码农软件 · 软件分类 · 其他开发相关 · 2019-10-16 08:56:34

软件介绍

pgxr —— 使用 Rust 开发 PostgreSQL 扩展函数(存储过程)

pgxr 是一个 Rust 的 crate 库,可以实现用 Rust 语言来编写 PostgreSQL 的扩展函数(相当于存储过程)。

代码示例:

#[macro_use]
extern crate pgxr;

use pgxr::bindings::*;

PG_MODULE_MAGIC!();

PG_FUNCTION_INFO_V1!(pg_finfo_pgxr_example_one);

#[no_mangle]
pub extern "C" fn pgxr_example_one(_fcinfo: FunctionCallInfo) -> Datum
{
    1
}

使用方法:

CREATE FUNCTION pgxr_example_one(integer) RETURNS integer
     AS 'libpgxr_example_one.so', 'pgxr_example_one'
     LANGUAGE C STRICT;

使用 Rust 开发 PostgreSQL 存储过程

https://my.oschina.net/u/1461794/blog/2353293

本文地址:https://codercto.com/soft/d/16864.html

RESTful Web Services Cookbook中文版

RESTful Web Services Cookbook中文版

Subbu Allamaraju / 丁雪丰、常可 / 电子工业出版社 / 2011-9 / 59.00元

RESTful Web Services Cookbook中文版:REST最佳实践手册,ISBN:9787121143908,作者:(美)Subbu Allamaraju(沙布·阿拉马拉尤)著,丁雪丰,常可 译一起来看看 《RESTful Web Services Cookbook中文版》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

MD5 加密
MD5 加密

MD5 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具