Emoji usage in cockroachdb

hi - could i please see an example of how to store an emoji in a column?

in the mariadb world i do something like this:

CREATE TABLE emojiTest
( name VARCHAR(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL
);
set names utf8mb4 collate ‘utf8mb4_unicode_ci’;
INSERT INTO emojiTest VALUES (‘:smile:’);
INSERT INTO emojiTest VALUES (‘ɚ’);
SELECT * from emojiTest;

thank you.

CockroachDB strings are UTF-8, so this works:

root@:26257/> create database d;
CREATE DATABASE
root@:26257/> create table d.t (s string);
CREATE TABLE
root@:26257/> insert into d.t values ('😄');
INSERT 1
root@:26257/> select * from d.t;
+----+
| s  |
+----+
| 😄 |
+----+
(1 row)
1 Like

wow that is certainly simple enough! thank you.