All Projects → truthly → Pg Emoji

truthly / Pg Emoji

Licence: mit
😍🐘 PostgreSQL emoji encode/decode extension

Labels

Projects that are alternatives of or similar to Pg Emoji

Pg query internals
Query PostgreSQL internals using SQL
Stars: ✭ 17 (-64.58%)
Mutual labels:  plpgsql
Basketball Data Scraper
A scraping library that gets you basketball data for the NBA and WNBA
Stars: ✭ 13 (-72.92%)
Mutual labels:  plpgsql
Google Analytics Bigquery Data Export
Export Google Analytics data from BigQuery using Standard or Legacy SQL.
Stars: ✭ 34 (-29.17%)
Mutual labels:  plpgsql
Postgis
PostGIS spatial database extension to PostgreSQL [mirror]
Stars: ✭ 925 (+1827.08%)
Mutual labels:  plpgsql
Scidb4geo
A SciDB Plugin for Managing Spatial and Temporal Reference Information of Arrays
Stars: ✭ 8 (-83.33%)
Mutual labels:  plpgsql
Sat Api Pg
A Postgres backed STAC API.
Stars: ✭ 20 (-58.33%)
Mutual labels:  plpgsql
Odata V4 Typeorm
OData to TYPEORM query compiler
Stars: ✭ 16 (-66.67%)
Mutual labels:  plpgsql
Spring Batch Admin Backend
Spring Batch Admin 是一个后端采用spring boot 2, spring security , oauth2, Spring data jpa 作为基础框架,集成了quartz 提供调度能力,集成了Spring batch 提供批处理能力的管理系统。系统旨在提供更底层数据展示以及常见批处理的配置以及运行能力。
Stars: ✭ 41 (-14.58%)
Mutual labels:  plpgsql
Medrianchor
The (Me)tadata (Dr)iven (Anchor) Model
Stars: ✭ 9 (-81.25%)
Mutual labels:  plpgsql
Backend Interview Prep Questions
A few questions & data to help you prepare for the Slack HQ backend interview
Stars: ✭ 34 (-29.17%)
Mutual labels:  plpgsql
Mallcloud Platform
mallcloud商城基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离vue的企业级微服务敏捷开发系统架构。并引入组件化的思想实现高内聚低耦合,项目代码简洁注释丰富上手容易,适合学习和企业中使用。真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案,面向互联网设计同时适合B端和C端用户,支持CI/CD多环境部署,并提供应用管理方便第三方系统接入;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等
Stars: ✭ 27 (-43.75%)
Mutual labels:  plpgsql
Elite
Stars: ✭ 7 (-85.42%)
Mutual labels:  plpgsql
Globalregion
全球国家/地区下拉级联,包含中英文国际化,国家/省份(直辖市)/城市(区)/县
Stars: ✭ 28 (-41.67%)
Mutual labels:  plpgsql
Geocode
Batch geocoding addressess, map to census block with PostGIS Tiger Geocoder
Stars: ✭ 23 (-52.08%)
Mutual labels:  plpgsql
Mingyuyue
古诗词取名后台
Stars: ✭ 37 (-22.92%)
Mutual labels:  plpgsql
Pg Mask
Simple data masking for PostgreSQL
Stars: ✭ 16 (-66.67%)
Mutual labels:  plpgsql
Sqlgenerate
Generates SQL when given an AST from the Codeschool/sqlite-parser
Stars: ✭ 14 (-70.83%)
Mutual labels:  plpgsql
Graphpostgresql
GraphQL for Postgres
Stars: ✭ 1,020 (+2025%)
Mutual labels:  plpgsql
Aquameta
Web development platform built entirely in PostgreSQL
Stars: ✭ 987 (+1956.25%)
Mutual labels:  plpgsql
Pgwatch2
PostgreSQL metrics monitor/dashboard
Stars: ✭ 960 (+1900%)
Mutual labels:  plpgsql

😍🐘pg-emoji

  1. About
  2. Dependencies
  3. Installation
  4. Usage
  5. API
    1. emoji.encode(bytea)→text
    2. emoji.decode(text)→bytea
    3. emoji.from_text(text)→text
    4. emoji.to_text(text)→text

1. About

emoji is a pure SQL PostgreSQL extension to encode/decode bytea/text to/from emoji.

A lookup-table is constructed from the first 1024 emojis from [https://unicode.org/Public/emoji/13.1/emoji-test.txt], where each emoji maps to a unique 10 bit sequence.

The input data is split into 10 bit fragments, mapped to the corresponding emojis.

The first emoji in the result is a header, where the first bit is 1 if the result was zero padded, and the remaining 9 bits is a checksum based on the input data.

If the checksum is invalid during decode, NULL is returned.

2. Dependencies

None.

3. Installation

Install the emoji extension with:

$ git clone https://github.com/truthly/pg-emoji.git
$ cd pg-emoji
$ make
$ sudo make install
$ make installcheck

4. Usage

Use with:

$ psql
# CREATE EXTENSION emoji;
CREATE EXTENSION;

5. API

emoji.encode(bytea)→text

SELECT emoji.encode('\x0123456789abcdef'::bytea);
  encode
----------
 👦😀🥺🪀🦠🖖🌌🥚
(1 row)

Making a subtle change to the input data will not only change the corresponding emoji, but also the first emoji which contains a 9-bit checksum of the data, which means it will change with 99.8% confidence (511/512). Notice in the example below what happens if the last f is changed to 7.

SELECT emoji.encode('\x0123458789abcde7'::bytea);
  encode
----------
 💜😀🥺🪀🍼🖖🌌🍕
(1 row)

emoji.decode(text)→bytea

SELECT emoji.decode('👦😀🥺🪀🦠🖖🌌🥚');
       decode
--------------------
 \x0123456789abcdef
(1 row)

Thanks to the first emoji containing a 9-bit checksum of the data, failing to properly copy/paste the entire emoji string will be detected upon decoding with 99.8% confidence and NULL will be returned.

SELECT emoji.decode('👦😀🥺🪀🦠🖖🌌');
 decode
--------

(1 row)

emoji.from_text(text)→text

SELECT emoji.from_text('Hello 🌎!');
 from_text
------------
 🦳🥺🐞🕰🎐🎗📷🧂🎖🫖
(1 row)

emoji.to_text(text)→text

SELECT emoji.to_text('🦳🥺🐞🕰🎐🎗📷🧂🎖🫖');
 to_text
----------
 Hello 🌎!
(1 row)
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].