squeal-postgresql-uuid-ossp-0.1.0.0: UUID OSSP extension for Squeal
Copyright(c) Eitan Chatav 2020
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.UUID.OSSP

Description

This module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. There are also functions to produce certain special UUID constants.

Synopsis

Definition

createUuidOssp :: Definition db db Source #

Loads ltree extension into the current database.

Generation

uuidGenerateV1 :: Expr (null 'PGuuid) Source #

This function generates a version 1 UUID. This involves the MAC address of the computer and a time stamp. Note that UUIDs of this kind reveal the identity of the computer that created the identifier and the time at which it did so, which might make it unsuitable for certain security-sensitive applications.

uuidGenerateV1mc :: Expr (null 'PGuuid) Source #

This function generates a version 1 UUID but uses a random multicast MAC address instead of the real MAC address of the computer.

uuidGenerateV3 :: '[null 'PGuuid, null 'PGtext] ---> null 'PGuuid Source #

This function generates a version 3 UUID in the given namespace using the specified input name. The namespace should be one of the special constants produced by the uuidNS* functions. (It could be any UUID in theory.) The name is an identifier in the selected namespace. For example: uuidGenerateV3 (uuidNSUrl *: "http://www.postgresql.org")

The name parameter will be MD5-hashed, so the cleartext cannot be derived from the generated UUID. The generation of UUIDs by this method has no random or environment-dependent element and is therefore reproducible.

uuidGenerateV4 :: Expr (null 'PGuuid) Source #

This function generates a version 4 UUID, which is derived entirely from random numbers.

uuidGenerateV5 :: '[null 'PGuuid, null 'PGtext] ---> null 'PGuuid Source #

This function generates a version 5 UUID, which works like a version 3 UUID except that SHA-1 is used as a hashing method. Version 5 should be preferred over version 3 because SHA-1 is thought to be more secure than MD5.

Constants

uuidNil :: Expr (null 'PGuuid) Source #

A "nil" UUID constant, which does not occur as a real UUID.

uuidNSUrl :: Expr (null 'PGuuid) Source #

Constant designating the URL namespace for UUIDs.

uuidNSDns :: Expr (null 'PGuuid) Source #

Constant designating the DNS namespace for UUIDs.

uuidNSOid :: Expr (null 'PGuuid) Source #

Constant designating the ISO object identifier (OID) namespace for UUIDs. (This pertains to ASN.1 OIDs, which are unrelated to the OIDs used in PostgreSQL.)

uuidNSX500 :: Expr (null 'PGuuid) Source #

Constant designating the X.500 distinguished name (DN) namespace for UUIDs.