pub struct PgLTree;
Available on crate feature
backend-postgres
only.Expand description
PostgreSQL ltree
extension type.
ltree
stores a raber path which in this struct is represented as the
tuple’s first value.
§PostcreSQL Reference
The following set of SQL statements can be used to create a table with
a ltree
column. Here the ltree
column is called path
.
The path
column is then populated to generate the tree.
ⓘ
CREATE TABLE test (path ltree);
INSERT INTO test VALUES ('Top');
INSERT INTO test VALUES ('Top.Science');
INSERT INTO test VALUES ('Top.Science.Astronomy');
INSERT INTO test VALUES ('Top.Science.Astronomy.Astrophysics');
INSERT INTO test VALUES ('Top.Science.Astronomy.Cosmology');
INSERT INTO test VALUES ('Top.Hobbies');
INSERT INTO test VALUES ('Top.Hobbies.Amateurs_Astronomy');
INSERT INTO test VALUES ('Top.Collections');
INSERT INTO test VALUES ('Top.Collections.Pictures');
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy');
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy.Stars');
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy.Galaxies');
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy.Astronauts');
CREATE INDEX path_gist_idx ON test USING GIST (path);
CREATE INDEX path_idx ON test USING BTREE (path);
The set of queries above will generate the following tree:
ⓘ
Top
/ | \
Science Hobbies Collections
/ | \
Astronomy Amateurs_Astronomy Pictures
/ \ |
Astrophysics Cosmology Astronomy
/ | \
Galaxies Stars Astronauts
Trait Implementations§
impl Eq for PgLTree
impl StructuralPartialEq for PgLTree
Auto Trait Implementations§
impl Freeze for PgLTree
impl RefUnwindSafe for PgLTree
impl Send for PgLTree
impl Sync for PgLTree
impl Unpin for PgLTree
impl UnwindSafe for PgLTree
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoColumnRef for Twhere
T: 'static + IntoIden,
impl<T> IntoColumnRef for Twhere
T: 'static + IntoIden,
fn into_column_ref(self) -> ColumnRef
source§impl<I> IntoIndexColumn for Iwhere
I: IntoIden,
impl<I> IntoIndexColumn for Iwhere
I: IntoIden,
fn into_index_column(self) -> IndexColumn
source§impl<T> IntoLikeExpr for T
impl<T> IntoLikeExpr for T
fn into_like_expr(self) -> LikeExpr
source§impl<T> IntoTableRef for Twhere
T: 'static + IntoIden,
impl<T> IntoTableRef for Twhere
T: 'static + IntoIden,
fn into_table_ref(self) -> TableRef
source§impl<I> IntoTypeRef for Iwhere
I: IntoIden,
impl<I> IntoTypeRef for Iwhere
I: IntoIden,
source§fn into_type_ref(self) -> TypeRef
fn into_type_ref(self) -> TypeRef
Available on crate feature
backend-postgres
only.