Skip to content

TypeDB Database Management in VS Code

TypeDB is a polymorphic database built around a conceptual data model and the TypeQL query language. Highlights include:

  • Conceptual model: Data is modelled as entity, relation, and attribute types rather than tables - relations are first-class and can play roles in other relations
  • Strong, inheritable types: Types form sub hierarchies, and ownership/role constraints (@key, @unique, @card) are enforced by the database
  • TypeQL: A declarative, pattern-based query language for matching, inserting, updating, and defining schema
  • Transactional: Read, write, and schema transactions with commit/rollback
  • TypeDB 3.x: DBCode connects over the TypeDB HTTP API (default port 8000)

TypeDB is commonly used for knowledge graphs, identity and access models, complex domain modelling, and any application where the relationships and constraints between concepts are as important as the data itself.

To connect to TypeDB in DBCode:

  1. Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
  2. Add a New Connection: Click on the “Add Connection” icon.
  3. Complete the connection form: Select TypeDB as the database type and enter:
    • Host address (default HTTP API port: 8000)
    • Username and password
    • Database name
    • Optional SSL/TLS configuration
  4. Connect: Click save to connect to your TypeDB server.
  5. Start exploring: Browse your entity, relation, and attribute types, and run TypeQL.

For detailed instructions on connecting, refer to the Connect article.

DBCode enhances your TypeDB development experience with:

  • TypeQL execution: Write and run TypeQL with results rendered in the grid
  • Type browsing: Explore the schema by entity, relation, and attribute types, with owned attributes, roles, super-types, annotations, and instance counts
  • Data editing: Open a type’s instances in an editable grid and update, insert, or delete rows; edits are keyed by each instance’s iid
  • Schema DDL: Create and drop entity, relation, and attribute types, truncate a type’s instances, and view a type’s define definition
  • Database management: Create and drop databases from the connection tree
  • Pinned transactions: Pin an editor to run several statements in one transaction and commit or roll back explicitly
  • Lossless 64-bit integers: Large integer values are preserved exactly, beyond JavaScript’s safe-integer range

By using TypeDB with DBCode, you can model and query your data with TypeQL while working within your familiar VS Code environment.

For more information about TypeDB, check out TypeDB.