@@ -13,7 +13,7 @@ use crate::storage::mvcc;
1313pub trait Engine < ' a > : Sized {
1414 /// The engine's transaction type. This provides both row-level CRUD operations and
1515 /// transactional access to the schema catalog.
16- type Transaction : Transaction + Catalog + ' a ;
16+ type Transaction : Transaction + ' a ;
1717
1818 /// Begins a read-write transaction.
1919 fn begin ( & ' a self ) -> Result < Self :: Transaction > ;
@@ -34,7 +34,7 @@ pub trait Engine<'a>: Sized {
3434/// All methods operate on row batches rather than single rows to amortize the
3535/// cost. With the Raft engine, each call results in a Raft roundtrip, and we'd
3636/// rather not have to do that for every single row that's modified.
37- pub trait Transaction {
37+ pub trait Transaction : Catalog {
3838 /// The transaction's internal MVCC state.
3939 fn state ( & self ) -> & mvcc:: TransactionState ;
4040
@@ -58,13 +58,9 @@ pub trait Transaction {
5858}
5959
6060/// The catalog stores table schema information. It must be implemented for
61- /// Engine:: Transaction, and is fully transactional. For simplicity, it only
61+ /// Transaction, and is thus fully transactional. For simplicity, it only
6262/// supports creating and dropping tables -- there are no ALTER TABLE schema
6363/// changes, nor CREATE INDEX.
64- ///
65- /// This type is separate from Transaction, even though Engine::Transaction
66- /// requires transactions to implement it. This allows better control of when
67- /// catalog access can be used (i.e. during planning, not execution).
6864pub trait Catalog {
6965 /// Creates a new table. Errors if it already exists.
7066 fn create_table ( & self , table : Table ) -> Result < ( ) > ;
0 commit comments