Gel Graph-Relational Database

repository·master·Indexed 11 days ago

https://github.com/geldata/gel

A graph-relational database combining relational strengths, graph databases, and ORMs. It features a type-based schema, the EdgeQL query language for structured data retrieval, and a specialized connection pool for QoS-optimized load balancing. Includes tools for profiling EdgeDB code via the @profile decorator and edb perfviz, as well as integration guides for Gel Cloud and Fly.io deployment.

Tokens
422.4K
Snippets
1.5K
Records
1.9K
Agent score
89%

What's inside Gel

  1. Overview of Gel AI tools

    master

    Gel AI provides a suite of tools to integrate AI capabilities into your applications with minimal effort. It consists of three primary interfaces:

    1. ext::ai Extension: A Gel extension that automatically generates embeddings for your data. It is compatible with any provider offering a compatible API, including OpenAI, Mistral AI, and Anthropic.
    2. Python Library (gel.ai): Provides direct access to all Gel AI features within Python applications.
    3. JavaScript Library (@gel/ai): Provides direct access to all Gel AI features within JavaScript backend applications.

    Additionally, the ext::vectorstore extension (powered by pgvector) can be used to replicate vectorstore-style workflows, allowing for the storage and searching of embedding vectors and integration with popular AI frameworks.

  2. Overview of using Gel

    master

    Gel provides several ways to interact with database instances, whether hosted locally or on a remote Cloud service. You can interact with Gel through:

    • Connections: Establishing links to running Gel instances.
    • Projects: A local development workflow that simplifies connection configuration and streamlines tasks for the CLI, language servers, and client libraries.
    • Command Line Interface (CLI): A tool for database administration, schema management, and REPL-based data exploration.
    • Client Libraries: High-level libraries for JavaScript, Python, Go, and Rust that include integrated connection pooling, management, and transaction retries.
  3. What is Gel?

    master

    Gel is a next-generation graph-relational database designed as a successor to the relational database. It combines the strengths of SQL databases—type safety, performance, reliability, and transactionality—with an object-oriented data model.

    Key Characteristics:

    • Data Model: Instead of tabular relations, Gel uses object types containing properties and links to other objects.
    • Query Language: Uses EdgeQL, a superpowered language designed to handle complex hierarchical data more easily than SQL.
    • Strict Schema: Unlike many graph databases, Gel maintains a strict, strongly typed schema.
    • Relational Core: While it supports hierarchical data like a document database, it uses relational database techniques for storage and querying.

    Core Features:

    • Strict, strongly typed schema.
    • Powerful and clean query language (EdgeQL).
    • Easy handling of complex hierarchical data.
    • Built-in support for schema migrations.
  4. Understand the core components of Gel

    master

    To work effectively with Gel, you need to master three primary components:

    1. Schema: Defining your data model using the Schema Definition Language (SDL).
    2. EdgeQL: Writing queries using EdgeQL, a next-generation query language designed for clarity and power.
    3. Standard Library: Utilizing the built-in type system (scalars, collections, objects) and the library of functions and operators.

    For advanced topics, syntax details, and internals, refer to the full Reference documentation.

  5. Manage Gel instances via the CLI

    master

    The gel instance command group provides a suite of tools for managing Gel server instances.

    Important Note: Most commands in this group are designed for managed Gel environments and are not intended for managing self-hosted instances. Check the specific documentation for individual commands to confirm compatibility with your setup.

    Available management tasks include:

    • Lifecycle Management: create, start, stop, restart, destroy.
    • Connectivity: link (to connect a remote instance), unlink (to disconnect a remote instance).
    • Observability: list (show all instances), status (show status of instances), logs (view instance logs).
    • Security: credentials (display credentials), reset-password (reset user passwords).
    • Maintenance: upgrade (upgrade installations/instances), revert (revert major upgrades).
  6. What is a Gel project?

    master

    A Gel project is a codebase linked to a specific Gel database instance. It is identified by the presence of a gel.toml file in the root directory.

    Key Benefits:

    • Automatic Connection: CLI commands and client libraries automatically connect to the linked instance without requiring connection flags or credentials (e.g., use gel migrate instead of gel -I my_instance migrate).
    • Portability: Teammates can quickly set up matching environments by running initialization commands.
    • Security: Separates connection details from code, avoiding hard-coded credentials.

    Note: Projects are intended for local development only. In production, always provide instance credentials via environment variables.

  7. Overview of the Gel Type System

    master

    Gel uses a rigorously defined type system categorized into scalar, collection, range, and object types. This system is supported by a built-in library of functions and operators designed for each specific datatype.

    Type Categories

    • Scalar Types: Primitive data storage including Strings, Numbers, Booleans, Dates and times, Enums, JSON, UUID, Bytes, Sequences, and Abstract types (which undergird the scalar hierarchy).
    • Collection Types: Generic types used to group data, specifically Arrays (homogeneous) and Tuples (heterogeneous).
    • Range Types: Specialized types for representing intervals, including Range and Multirange.
    • Object Types: Complex data structures defined by the user.
    • Types and Sets: Includes Sets, Types, and Casting mechanisms.

    Built-in Utilities and Extensions

    Gel provides several utility libraries for common operations:

    • Math: Mathematical functions.
    • Comparison: Generic comparison operators.
    • Constraints: Logic for data validation.
    • Full-text Search (FTS): Tools for text indexing and searching.
    • System: System-level functions.
    • Extensions: Support for specialized data types like pgvector.
  8. What is EdgeQL?

    master

    EdgeQL is a next-generation, object-relational query language used to interact with Gel databases. It is designed to be more intuitive and concise than SQL by bridging the gap between the relational paradigm and the object-oriented nature of modern programming languages.

    Key capabilities include:

    • Querying data
    • Inserting, updating, and deleting data
    • Modifying and introspecting the schema
    • Managing transactions
    • Performing deep queries through links without explicit JOIN syntax