Skip to content

Version 26.10/24

Compare
Choose a tag to compare
@j1sk1ss j1sk1ss released this 25 Oct 19:23
· 68 commits to main since this release

Module architecture implemented. Now, users can create their own modules *.mdl for CDBMS. For this, they can just compile C / C++ ... whatever lang program, that take args and print to stdout stream result.

Example on C:

char* get_current_time() {
    time_t rawtime;
    struct tm* timeinfo;

    time(&rawtime);
    timeinfo = localtime(&rawtime);
    char* time_str = asctime(timeinfo);
    time_str[strlen(time_str) - 1] = '\0';

    return time_str;
}

int main(int argc, char* argv[]) {
    if (argc != 2) exit(1);
    if (strcmp(argv[1], NOW) == 0) {
        printf("%s", get_current_time());
        return 100;
    }

    return 2;
}

Code should return 100 exit code, if operation was success. For using this module, user can add link in table column:

db create table <name> <rwd> columns ( <name> <size> <module_name>=<args>,<type mpre / mpost> <primary> <auto> )

Also CDBMS convert any args, where placed column names to values, that stored in this columns. It means, that if we use calc module with formula "uid*value", where uid and value is column names, it will be replaced with values of this columns in this row.