SQLite stubs
This commit is contained in:
parent
d11c243599
commit
c1dcd5b218
|
@ -18,6 +18,7 @@ package sqlite3
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal"
|
"github.com/matrix-org/dendrite/internal"
|
||||||
|
@ -111,3 +112,9 @@ func (s *eventJSONStatements) BulkSelectEventJSON(
|
||||||
}
|
}
|
||||||
return results[:i], nil
|
return results[:i], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *eventJSONStatements) PurgeEventJSONs(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -646,3 +646,9 @@ func (s *eventStatements) SelectEventRejected(
|
||||||
err = stmt.QueryRowContext(ctx, roomNID, eventID).Scan(&rejected)
|
err = stmt.QueryRowContext(ctx, roomNID, eventID).Scan(&rejected)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *eventStatements) PurgeEvents(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package sqlite3
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal"
|
"github.com/matrix-org/dendrite/internal"
|
||||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||||
|
@ -158,3 +159,9 @@ func (s *inviteStatements) SelectInviteActiveForUserInRoom(
|
||||||
}
|
}
|
||||||
return result, eventIDs, nil
|
return result, eventIDs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *inviteStatements) PurgeInvites(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -407,3 +407,9 @@ func (s *membershipStatements) DeleteMembership(
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *membershipStatements) PurgeMemberships(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -129,3 +129,9 @@ func (s *previousEventStatements) SelectPreviousEventExists(
|
||||||
stmt := sqlutil.TxStmt(txn, s.selectPreviousEventExistsStmt)
|
stmt := sqlutil.TxStmt(txn, s.selectPreviousEventExistsStmt)
|
||||||
return stmt.QueryRowContext(ctx, eventID, eventReferenceSHA256).Scan(&ok)
|
return stmt.QueryRowContext(ctx, eventID, eventReferenceSHA256).Scan(&ok)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *previousEventStatements) PurgePreviousEvents(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ package sqlite3
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal"
|
"github.com/matrix-org/dendrite/internal"
|
||||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||||
|
@ -106,3 +107,9 @@ func (s *publishedStatements) SelectAllPublishedRooms(
|
||||||
}
|
}
|
||||||
return roomIDs, rows.Err()
|
return roomIDs, rows.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *publishedStatements) PurgePublished(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomID string,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -17,9 +17,11 @@ package sqlite3
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||||
"github.com/matrix-org/dendrite/roomserver/storage/tables"
|
"github.com/matrix-org/dendrite/roomserver/storage/tables"
|
||||||
|
"github.com/matrix-org/dendrite/roomserver/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const redactionsSchema = `
|
const redactionsSchema = `
|
||||||
|
@ -121,3 +123,9 @@ func (s *redactionStatements) MarkRedactionValidated(
|
||||||
_, err := stmt.ExecContext(ctx, validated, redactionEventID)
|
_, err := stmt.ExecContext(ctx, validated, redactionEventID)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *redactionStatements) PurgeRedactions(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package sqlite3
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal"
|
"github.com/matrix-org/dendrite/internal"
|
||||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||||
|
@ -143,3 +144,9 @@ func (s *roomAliasesStatements) DeleteRoomAlias(
|
||||||
_, err := stmt.ExecContext(ctx, alias)
|
_, err := stmt.ExecContext(ctx, alias)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *roomAliasesStatements) PurgeRoomAliases(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomID string,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -141,3 +141,9 @@ func (s *stateBlockStatements) BulkSelectStateBlockEntries(
|
||||||
}
|
}
|
||||||
return results, err
|
return results, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *stateBlockStatements) PurgeStateBlocks(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
|
@ -146,3 +146,9 @@ func (s *stateSnapshotStatements) BulkSelectStateForHistoryVisibility(
|
||||||
) ([]types.EventNID, error) {
|
) ([]types.EventNID, error) {
|
||||||
return nil, tables.OptimisationNotSupportedError
|
return nil, tables.OptimisationNotSupportedError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *stateSnapshotStatements) PurgeStateSnapshots(
|
||||||
|
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("not implemented on SQLite")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue