Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TYPE CONTINUATION;
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use error_stack::Report;
use hash_graph_migrations::{Context, Migration};
use tokio_postgres::Client;
use tracing::Instrument as _;

pub struct Query;

impl Migration for Query {
type Context = Client;
type Error = tokio_postgres::Error;

async fn up(
self,
context: &mut <Self::Context as Context>::Transaction<'_>,
) -> Result<(), Report<Self::Error>> {
context
.simple_query(include_str!("up.sql"))
.instrument(tracing::info_span!(
"BATCH",
otel.kind = "client",
db.system = "postgresql",
peer.service = "Postgres",
))
.await?;
Ok(())
}

async fn down(
self,
context: &mut <Self::Context as Context>::Transaction<'_>,
) -> Result<(), Report<Self::Error>> {
context
.simple_query(include_str!("down.sql"))
.instrument(tracing::info_span!(
"BATCH",
otel.kind = "client",
db.system = "postgresql",
peer.service = "Postgres",
))
.await?;
Ok(())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TYPE continuation AS (filter boolean, block int, locals int [], values jsonb []);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TYPE continuation AS (filter boolean, block int, locals int[], values jsonb[]);
2 changes: 1 addition & 1 deletion libs/@local/graph/postgres-store/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod error;
mod config;
mod validation;

pub(crate) mod postgres;
pub mod postgres;

pub use self::{
config::{DatabaseConnectionInfo, DatabasePoolConfig, DatabaseType},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ use type_system::knowledge::Entity;

use super::expression::{JoinType, TableName, TableReference};
use crate::store::postgres::query::{
Alias, Column, Distinctness, EqualityOperator, Expression, Function, PostgresQueryPath,
PostgresRecord, SelectExpression, SelectStatement, Table, Transpile as _, WindowStatement,
Alias, Column, Distinctness, EqualityOperator, Expression, Function, Identifier,
PostgresQueryPath, PostgresRecord, SelectExpression, SelectStatement, Table, Transpile as _,
WindowStatement,
expression::{FromItem, GroupByExpression, PostgresType},
table::{
DataTypeEmbeddings, DatabaseColumn as _, EntityEditions, EntityEmbeddings,
Expand Down Expand Up @@ -440,7 +441,7 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> {
.map(|filter| self.compile_filter(filter))
.collect::<Result<_, _>>()?,
),
Filter::Not(filter) => Expression::not(self.compile_filter(filter)?),
Filter::Not(filter) => self.compile_filter(filter)?.not(),
Filter::Equal(lhs, rhs) => Expression::equal(
self.compile_filter_expression(lhs).0,
self.compile_filter_expression(rhs).0,
Expand Down Expand Up @@ -616,7 +617,7 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> {
parameter_expression,
)),
)),
alias: Some("distance"),
alias: Some(Identifier::from("distance")),
}))
.collect(),
)
Expand Down Expand Up @@ -744,7 +745,7 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> {
Column::OntologyIds(OntologyIds::BaseUrl).aliased(alias),
)),
),
alias: Some("latest_version"),
alias: Some(Identifier::from("latest_version")),
},
])
.from(
Expand Down
Loading
Loading