Welcome to the TileDB docs!

Here you will find a comprehensive description of all the TileDB features, installation guides, tutorials, and API references. You will also be able to suggest edits and submit your questions. Enjoy!

Get Started    

Creating a TileDB Group

This example creates TileDB groups my_group, dense_arrays and sparse_arrays in the current working directory, such that my_group contains dense_arrays and sparse_arrays, i.e.:

my_group
    |__ dense_arrays
    |__ sparse_arrays
#include <tiledb.h>

int main() {
  // Create context
  tiledb_ctx_t* ctx;
  tiledb_ctx_create(&ctx, NULL);

  // Create a group
  tiledb_group_create(ctx, "my_group");

  // Create two groups inside the first group
  tiledb_group_create(ctx, "my_group/dense_arrays");
  tiledb_group_create(ctx, "my_group/sparse_arrays");

  // Clean up
  tiledb_ctx_free(&ctx);

  return 0;
}
#include <tiledb>

int main() {
  tiledb::Context ctx;
  tiledb::create_group(ctx, "my_group");
  tiledb::create_group(ctx, "my_group/dense_arrays");
  tiledb::create_group(ctx, "my_group/sparse_arrays");
}
import tiledb

def main():
    ctx = tiledb.Ctx()
    tiledb.group_create(ctx, "my_group")
    tiledb.group_create(ctx, "my_group/dense_arrays")
    tiledb.group_create(ctx, "my_group/sparse_arrays")

if __name__ == '__main__':
    main()

Program output

Make sure that no directory with name my_group exists in the current working directory before running the program.

$ ./tiledb_group_create_c
$ ls -1 my_group
__tiledb_group.tdb
dense_arrays
sparse_arrays
$ ls -1 my_group/dense_arrays
__tiledb_group.tdb
$ ls -1 my_group/sparse_arrays
__tiledb_group.tdb
$ ./tiledb_group_create_cpp
$ ls -1 my_group
__tiledb_group.tdb
dense_arrays
sparse_arrays
$ ls -1 my_group/dense_arrays
__tiledb_group.tdb
$ ls -1 my_group/sparse_arrays
__tiledb_group.tdb
$ python tiledb_group_create.py
$ ls -1 my_group
__tiledb_group.tdb
dense_arrays
sparse_arrays
$ ls -1 my_group/dense_arrays
__tiledb_group.tdb
$ ls -1 my_group/sparse_arrays
__tiledb_group.tdb

Creating a TileDB Group