Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Keep a graph in a SQLite file, read and written by the object managers

Aberta
#80 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
python, sqlite
Domínio
databases

Direção de pesquisa

Start by tracing the existing object manager read and write paths and the PostgreSQL write plan, then compare the current SQL store schema with the listed SQLite table layout. Check the SQLite driver’s function registration, transaction, and version support before mapping the required graph operations. Done means object managers can read and write interoperable SQLite graph files while meeting the layout contract, including JSON text, stamps, and nanosecond moment comparisons.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Port of liberation-data/drivine4j#194.

drivine4j can now keep a graph in a SQLite file, and its object managers read and write it. The file has the same tables as Oracle and Postgres, so each library can read a file another wrote:

  • <graph>_node (nid INTEGER PRIMARY KEY, labels TEXT, props TEXT, stamp TEXT)
  • <graph>_edge (eid INTEGER PRIMARY KEY, src, dst REFERENCES node ON DELETE CASCADE, type, props TEXT)
  • <graph>_schema

Layout contract. These are what make one library's file readable by another:

  • Labels and properties are JSON text, not SQLite's binary jsonb. Labels are written sorted and unescaped (no \uXXXX: in Python, json.dumps(..., ensure_ascii=False)), because a label is found by the text "Label" within labels.
  • The stamp is a column, as on the other SQL stores.
  • Moments are ISO text, compared to the nanosecond.

How drivine4j does it. These can be followed or done another way:

  • Writes: the same write plan Postgres's function carries out, carried out by a function registered on each connection (drivine_write) under a savepoint. better-sqlite3's db.function and Python's create_function can do the same.
  • Deletes that count select their nodes and hand them to drivine_delete.
  • Other registered functions:
    • drivine_epoch(text): epoch nanoseconds, for comparing moments;
    • REGEXP;
    • a Unicode lower;
    • cosine and Euclidean similarity, for vector search by scanning.
  • Connections: WAL, foreign_keys=ON, a busy timeout, and BEGIN IMMEDIATE for writing transactions. A save or delete turned away with SQLITE_BUSY is run again.
  • Minimum SQLite: 3.45. Python's bundled sqlite3 can be older; pysqlite3-binary is one way round that.

Cypher on SQLite (the compiler's third target) follows in a later drivine4j PR, with its own port issue.

Linguagem predominante
Python
Estrelas
1
Forks
0
Merge médio
1h 21min
PRs com merge (30d)
128

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de liberation-data/drivine-python

Todas as issues de liberation-data/drivine-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.