Skip to content

Add VECTOR field type support to Quick SQL #88

Description

@pallasinfotech
## Title

Add VECTOR field type support to Quick SQL

## Summary

Quick SQL should support generation of Oracle Database `VECTOR` columns so developers can create AI-ready table definitions directly from Quick SQL shorthand.

Oracle Database supports the `VECTOR` data type for AI Vector Search and embedding-based applications. APEX developers building semantic search, RAG, recommendation engines, document search, and similarity-matching apps increasingly need tables with vector embedding columns.

Currently, developers must generate the table DDL with Quick SQL and then manually edit the SQL to add `VECTOR` columns. Native Quick SQL support would remove that friction.

## Requested Enhancement

Add support for `VECTOR` as a valid Quick SQL field type.

Example Quick SQL input:

```sql
documents
  title vc200
  body clob
  embedding vector
  embedding_1536 vector(1536, float32)
  embedding_int8 vector(768, int8)
  sparse_embedding vector(*, float32, sparse)

Expected generated SQL:

create table documents (
    id                number generated by default on null as identity,
    title             varchar2(200),
    body              clob,
    embedding         vector,
    embedding_1536    vector(1536, float32),
    embedding_int8    vector(768, int8),
    sparse_embedding  vector(*, float32, sparse),
    constraint documents_pk primary key (id)
);

Suggested Syntax

Quick SQL should support the following forms:

vector
vector(n)
vector(n, float32)
vector(n, float64)
vector(n, int8)
vector(n, binary)
vector(*, float32)
vector(n, float32, dense)
vector(n, float32, sparse)

Optional shorthand aliases could also be considered:

vec
vec1536
vec1536f32

However, supporting the full vector(...) syntax would be clearer, more explicit, and more future-proof.

Optional Validation

Quick SQL could optionally provide warnings when:

  • A BINARY vector dimension is not a multiple of 8.
  • A vector column is used as a primary key.
  • A vector column is used as a foreign key.
  • A vector column is used in a unique constraint.
  • A default value is specified for a vector column.
  • A vector index is requested on a column without fixed dimensions.

Optional Future Enhancement: Vector Index Generation

A future enhancement could add syntax for generating vector indexes.

Example Quick SQL input:

documents
  title vc200
  body clob
  embedding vector(1536, float32) /vector_index hnsw cosine

Possible generated SQL:

create vector index documents_embedding_hnsw_idx
on documents (embedding)
organization inmemory neighbor graph
distance cosine;

Use Cases

This enhancement would help developers quickly prototype and build:

  • RAG document repositories
  • Semantic search applications
  • AI-powered knowledge bases
  • Product recommendation engines
  • Similarity-matching applications
  • Image/text embedding storage
  • Hybrid relational + vector search applications

Business Value

Adding VECTOR support would make Quick SQL more useful for modern AI application development in Oracle APEX.

It would allow developers to create AI-ready schemas directly from shorthand without manually editing generated DDL, helping align Quick SQL with Oracle Database AI Vector Search capabilities.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions