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 Context

Most of the TileDB functions require as input a TileDB context. The context is essentially some state about all the internal structures of the TileDB storage manager. You need to create the context before using the API functions.

#include <tiledb.h>

int main() {
  // Create TileDB context
  tiledb_ctx_t* ctx;
  tiledb_ctx_create(&ctx, NULL);
  
  /* --- Your TileDB code here --- */ 
  
  // Clear context
  tiledb_ctx_free(&ctx);
  
  return 0; 
}
#include <tiledb>

int main() {
  // Create TileDB context
  tiledb::Context ctx;
    
  /* --- Your TileDB code here --- */ 
  
  // The context will be deleted when it exits its scope
  
  return 0; 
}
import tiledb

def main():
    # Create TileDB context
    ctx = tiledb.Ctx()
    
    # --- Your TileDB code here --- #
  
    # The context will be deleted when it exits its scope
  
if __name__ == '__main__':
    main()

Creating a TileDB Context