Socket
Socket
Sign inDemoInstall

pg-mem-uuid-ossp

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pg-mem-uuid-ossp

UUID-OSSP extension for pg-mem


Version published
Weekly downloads
90
decreased by-41.94%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

uuid-ossp extension for pg-mem

Installation

Using npm:

$ {sudo -H} npm i -g npm
$ npm i --save pg-mem-uuid-ossp

Usage

In Node.js:

var { newDb } = require('pg-mem');
var { uuidOssp } = require('pg-mem-uuid-ossp');

With typescript:

import { newDb } from 'pg-mem';
import { uuidOssp } from 'pg-mem-uuid-ossp';

Then use it:

const db = newDb();
db.registerExtension('uuid-ossp', uuidOssp);
...
db.public.many(`
  create extension "uuid-ossp";
  select uuid_generate_v4();
`);

Functions defined

This extension intends to emulate the PostgreSQL uuid-ossp extension, so it defines the following functions:

Functions for UUID Generation

  • uuid_generate_v1() -> uuid
  • uuid_generate_v1mc() -> uuid (synonym for uuid_generate_v1)
  • uuid_generate_v3(namespace uuid, name text) -> uuid
  • uuid_generate_v4() ->
  • uuid_generate_v5(namespace uuid, name text) -> uuid

Functions returning UUID Constants

The RFC4122 defines 4 UUID namespaces that PostgreSQL uuid-ossp extension returns in the following 4 functions:

  • uuid_ns_dns() -> uuid
  • uuid_ns_url() -> uuid
  • uuid_ns_oid() -> uuid
  • uuid_ns_x500() -> uuid

That RFC also defines a Nil UUID:

  • uuid_nil() -> uuid

Keywords

FAQs

Last updated on 18 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc