Locale: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<source lang="c">
<syntaxhighlight lang="c">
static char *base36enc(long unsigned int value) {
static char *base36enc(long unsigned int value) {
     char base36[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
     char base36[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Line 17: Line 17:
     return strtoul(text, NULL, 36);
     return strtoul(text, NULL, 36);
}
}
</source>
</syntaxhighlight>


----
----
Line 68: Line 68:
| valign="top" |
| valign="top" |
===Data===
===Data===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     data_type_code,
     data_type_code,
Line 80: Line 80:
FROM
FROM
     M00TM00X00
     M00TM00X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Error===
===Error===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     error_type_code,
     error_type_code,
Line 96: Line 96:
FROM
FROM
     M00TM01X00
     M00TM01X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Mime===
===Mime===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     mime_type_code,
     mime_type_code,
Line 112: Line 112:
FROM
FROM
     M00TM##X00
     M00TM##X00
</source>
</syntaxhighlight>
|}
|}


Line 119: Line 119:
| valign="top" |
| valign="top" |
===Tables===
===Tables===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     table_code,
     table_code,
Line 135: Line 135:
FROM
FROM
     M00TM02X00
     M00TM02X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |


===Forms===
===Forms===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     form_code,
     form_code,
Line 156: Line 156:
FROM
FROM
     M00TM03X00
     M00TM03X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Reports===
===Reports===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     report_code,
     report_code,
Line 176: Line 176:
FROM
FROM
     M00TM04X00
     M00TM04X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Errors===
===Errors===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     error_code,
     error_code,
Line 196: Line 196:
FROM
FROM
     M00TM05X00
     M00TM05X00
</source>
</syntaxhighlight>
|}
|}


Line 203: Line 203:
| valign="top" |
| valign="top" |
===Fields===
===Fields===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     field_code,
     field_code,
Line 217: Line 217:
FROM
FROM
     M00TM06X00
     M00TM06X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Forms===
===Forms===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     label_code,
     label_code,
Line 235: Line 235:
FROM
FROM
     M00TM07X00
     M00TM07X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Reports===
===Reports===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     label_code,
     label_code,
Line 253: Line 253:
FROM
FROM
     M00TM08X00
     M00TM08X00
</source>
</syntaxhighlight>
|}
|}


Line 260: Line 260:
| valign="top" |
| valign="top" |
===Languages===
===Languages===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     lingo_code,
     lingo_code,
Line 279: Line 279:
FROM
FROM
     M00TL00X00
     M00TL00X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Countries===
===Countries===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     country_code,
     country_code,
Line 302: Line 302:
FROM
FROM
     M00TL01X00
     M00TL01X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |


===Currencies===
===Currencies===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     notes_code,
     notes_code,
Line 326: Line 326:
FROM
FROM
     M00TL02X00
     M00TL02X00
</source>
</syntaxhighlight>
|}
|}


Line 333: Line 333:
| valign="top" |
| valign="top" |
===Tables===
===Tables===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     translated_code,
     translated_code,
Line 350: Line 350:
FROM
FROM
     M00TL03X00
     M00TL03X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Forms===
===Forms===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     translated_code,
     translated_code,
Line 371: Line 371:
FROM
FROM
     M00TL04X00
     M00TL04X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Reports===
===Reports===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     created_at,
     enter_by,
     created_by,
     amend_at,
     updated_at,
     amend_by,
     updated_by,
     revision,
     version_no,
     id,
     id,
     translated_code,
     translated_code,
Line 392: Line 392:
FROM
FROM
     M00TL05X00
     M00TL05X00
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
===Errors===
===Errors===
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT
SELECT
     enter_at,
     enter_at,
Line 413: Line 413:
FROM
FROM
     M00TL06X00
     M00TL06X00
</source>
</syntaxhighlight>
|}
|}
==Proposed==
{|
| valign="top" |
sense of old user
──────────────────────────
id      : Base36Id
revision: Number
enter_at: DateTime
enter_by: Base36Id
enter_on: Base36Id
amend_at: DateTime
amend_by: Base36Id
amend_on: Base36Id
trash_at: DateTime
code    : Base36Code
| valign="top" |
sense of gui user
──────────────────────────
id      : Base36Id
revision : Number
create_at: DateTime
create_by: Base36Id
create_on: Base36Id
update_at: DateTime
update_by: Base36Id
update_on: Base36Id
delete_at: DateTime
code    : Base36Code
| valign="top" |
sense of sql user
──────────────────────────
id        : Base36Id
revision  : Number
inserted_at: DateTime
inserted_by: Base36Id
inserted_on: Base36Id
updated_at : DateTime
updated_by : Base36Id
updated_on : Base36Id
deleted_at : DateTime
code      : Base36Code
| valign="top" |
'''√ sense of any user'''
──────────────────────────
id        : '''Base36Id'''
version_no: '''Number'''
created_at: '''DateTime'''
created_by: '''Base36Id'''
created_on: '''Base36Id'''
updated_at: '''DateTime'''
updated_by: '''Base36Id'''
updated_on: '''Base36Id'''
deleted_at: '''DateTime'''
code      : '''Base36Code'''
|-
| colspan="4" |
----
|-
| valign="top" colspan="2" |
<syntaxhighlight lang="json">
{
  "properties":{},        // more generic properties
  "extendedProperties":{}, // less generic properties
  "externalProperties":{}, // peer partner properties
  "inherentProperties":{}, // json scratch properties
  "coherentProperties":{}  // json ordered properties
}
</syntaxhighlight>
| valign="top" colspan="2" |
|}
----
We are thinking about '''unstructured document''' data using JSON or JSON Binary Data. It's more important to us. It's never be wise as well make another layer of complexity when we are trying to handle lot of fields in single Database Table. For such cases we need replace multiple columns by using JSON or JSON Binary Data.


==References==
==References==
{|
| valign="top" |
* [https://dbpedia.org/page/ISO/IEC_5218 Locale » ISO/IEC_5218 » Human Sexes]
* [https://help.sap.com/docs/SAP_BUSINESSOBJECTS_BUSINESS_INTELLIGENCE_PLATFORM/09382741061c40a989fae01e61d54202/46758c5e6e041014910aba7db0e91070.html Locale » List and their dominant]
* [https://saimana.com/list-of-country-locale-code/ Locale » List of Country Codes]
| valign="top" |
| valign="top" |
|-
| colspan="3" |
----
|-
| valign="top" |
* [https://programmer.group/oracle-to-mysql-database-migration-primary-key-generation-policy-replacement.html Using MySQL table to simulate Oracle Sequence]
* [https://coderanch.com/t/573996/databases/SequenceGenerator-MySql-Database <code>@SequenceGenerator</code> for MySql Database]
* [https://docs.liquibase.com/change-types/community/create-sequence.html#:~:text=Database%20support Create Sequence Supported Database]
* [https://danielmiessler.com/study/difference-between-uri-url/ Difference Between a URI and a URL]
* [https://danielmiessler.com/study/difference-between-uri-url/ Difference Between a URI and a URL]
* [https://www.englishclub.com/grammar/prepositions-at-in-on-time.htm Prepositions of Time - at, in, on]
* [https://www.englishclub.com/grammar/prepositions-at-in-on-time.htm Prepositions of Time - at, in, on]
Line 423: Line 520:
* [https://en.wikipedia.org/wiki/Base36 Base36]
* [https://en.wikipedia.org/wiki/Base36 Base36]
* [https://en.wikipedia.org/wiki/Base32 Base32]
* [https://en.wikipedia.org/wiki/Base32 Base32]
* [http://www.dbunit.org/howto.html DBUnit]
* [https://www.dbunit.org/howto.html DBUnit]
 
| valign="top" |
* [[PostgreSQL#Encode.2FDecode|PostgreSQL]]
* [[MapStruct]]
* [[Liquibase]]
* [[Lombok]]
* [[HTTPie]]
* [[CURL]]
* [[JPA#Sequence_Style|JPA]]
 
| valign="top" |
 
|}

Latest revision as of 20:43, 22 April 2024

static char *base36enc(long unsigned int value) {
    char base36[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    /* log(2**64) / log(36) = 12.38 => max 13 char + '\0' */
    char buffer[14];
    unsigned int offset = sizeof(buffer);

    buffer[--offset] = '\0';
    do {
        buffer[--offset] = base36[value % 36];
    } while (value /= 36);

    return strdup(&buffer[offset]); // warning: this must be free-d by the user
}

static long unsigned int base36dec(const char *text) {
    return strtoul(text, NULL, 36);
}

Index Binary Char Index Binary Char Index Binary Char Index Binary Char
0 000000 0 16 010000 G 32 100000 W 48 110000 m
1 000001 1 17 010001 H 33 100001 X 49 110001 n
2 000010 2 18 010010 I 34 100010 Y 50 110010 o
3 000011 3 19 010011 J 35 100011 Z 51 110011 p
4 000100 4 20 010100 K 36 100100 a 52 110100 q
5 000101 5 21 010101 L 37 100101 b 53 110101 r
6 000110 6 22 010110 M 38 100110 c 54 110110 s
7 000111 7 23 010111 N 39 100111 d 55 110111 t
8 001000 8 24 011000 O 40 101000 e 56 111000 u
9 001001 9 25 011001 P 41 101001 f 57 111001 v
10 001010 A 26 011010 Q 42 101010 g 58 111010 w
11 001011 B 27 011011 R 43 101011 h 59 111011 x
12 001100 C 28 011100 S 44 101100 i 60 111100 y
13 001101 D 29 011101 T 45 101101 j 61 111101 z
14 001110 E 30 011110 U 46 101110 k 62 111110 _
15 001111 F 31 011111 V 47 101111 l 63 111111 .

Types

Data

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    data_type_code,
    data_type_name
FROM
    M00TM00X00

Error

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    error_type_code,
    error_type_name
FROM
    M00TM01X00

Mime

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    mime_type_code,
    mime_type_name
FROM
    M00TM##X00

Objects

Tables

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    table_code,
    table_nome,
    data_type_code,



FROM
    M00TM02X00

Forms

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    form_code,
    form_name,
    data_type_code,
    apps_type,
    base_flag,
    base_form
FROM
    M00TM03X00

Reports

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    report_code,
    report_name,
    data_type_code,



FROM
    M00TM04X00

Errors

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    error_code,
    error_name,
    error_type_code,



FROM
    M00TM05X00

Labels

Fields

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    field_code,
    table_code,
    field_order,
    field_name
FROM
    M00TM06X00

Forms

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    label_code,
    form_code,
    label_name,
    label_value
FROM
    M00TM07X00

Reports

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    label_code,
    report_code,
    label_name,
    label_value
FROM
    M00TM08X00

Localizations

Languages

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    lingo_code,
    iso_alpha2_lingo_code,
    iso_alpha3_lingo_code,





    lingo_name
FROM
    M00TL00X00

Countries

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    country_code,
    iso_alpha2_country_code,
    iso_alpha3_country_code,
    longitude,
    latitude,
    altitude,


    country_name
FROM
    M00TL01X00

Currencies

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    notes_code,
    iso_alpha3_notes_code,
    iso_alpha3_state_code,
    iso_numeric_code,
    official_flag,
    decimal_point,
    notes_symbol,
    crypto_flag,
    notes_name
FROM
    M00TL02X00

Translations

Tables

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    translated_code,
    table_code,
    field_code,
    field_value,
    iso_alpha2_lingo_code,
    iso_alpha2_state_code,
    translated_value
FROM
    M00TL03X00

Forms

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    translated_code,
    form_code,
    label_code,

    iso_alpha2_lingo_code,
    iso_alpha2_state_code,
    translated_value
FROM
    M00TL04X00

Reports

SELECT
    created_at,
    created_by,
    updated_at,
    updated_by,
    version_no,
    id,
    translated_code,
    report_code,
    label_code,

    iso_alpha2_lingo_code,
    iso_alpha2_state_code,
    translated_value
FROM
    M00TL05X00

Errors

SELECT
    enter_at,
    enter_by,
    amend_at,
    amend_by,
    revision,
    id,
    translated_code,
    error_code,


    iso_alpha2_lingo_code,
    iso_alpha2_state_code,
    translated_value
FROM
    M00TL06X00

Proposed

sense of old user
──────────────────────────
id      : Base36Id
revision: Number
enter_at: DateTime
enter_by: Base36Id
enter_on: Base36Id
amend_at: DateTime
amend_by: Base36Id
amend_on: Base36Id
trash_at: DateTime
code    : Base36Code
sense of gui user
──────────────────────────
id       : Base36Id
revision : Number
create_at: DateTime
create_by: Base36Id
create_on: Base36Id
update_at: DateTime
update_by: Base36Id
update_on: Base36Id
delete_at: DateTime
code     : Base36Code
sense of sql user
──────────────────────────
id         : Base36Id
revision   : Number
inserted_at: DateTime
inserted_by: Base36Id
inserted_on: Base36Id
updated_at : DateTime
updated_by : Base36Id
updated_on : Base36Id
deleted_at : DateTime
code       : Base36Code
√ sense of any user
──────────────────────────
id        : Base36Id
version_no: Number
created_at: DateTime
created_by: Base36Id
created_on: Base36Id
updated_at: DateTime
updated_by: Base36Id
updated_on: Base36Id
deleted_at: DateTime
code      : Base36Code

{
  "properties":{},         // more generic properties
  "extendedProperties":{}, // less generic properties
  "externalProperties":{}, // peer partner properties
  "inherentProperties":{}, // json scratch properties
  "coherentProperties":{}  // json ordered properties
}

We are thinking about unstructured document data using JSON or JSON Binary Data. It's more important to us. It's never be wise as well make another layer of complexity when we are trying to handle lot of fields in single Database Table. For such cases we need replace multiple columns by using JSON or JSON Binary Data.

References