Documentation
¶
Index ¶
Constants ¶
View Source
const (
// CreateSyncTokensTableQuery is the SQL query to create the sync_tokens table
CreateSyncTokensTableQuery = `
CREATE TABLE IF NOT EXISTS sync_tokens (id INTEGER PRIMARY KEY AUTOINCREMENT, updated_at DATETIME NOT NULL);
`
)
Variables ¶
View Source
var ( // UpdateLastSyncTokensUpdatedAtQuery is the SQL query to insert a new sync tokens record UpdateLastSyncTokensUpdatedAtQuery = ` INSERT INTO sync_tokens (updated_at) VALUES (?); ` // GetLastSyncTokensUpdatedAtQuery is the SQL query to get the last sync tokens record GetLastSyncTokensUpdatedAtQuery = ` SELECT updated_at FROM sync_tokens ORDER BY updated_at DESC LIMIT 1; ` )
Functions ¶
This section is empty.
Types ¶
type Service ¶ added in v0.7.3
type Service struct {
godatabasessql.Service
// contains filtered or unexported fields
}
Service is the default implementation of the Service interface
func NewService ¶ added in v0.7.3
NewService creates a new Service
Parameters:
- service: the SQL connection service
- logger: the logger (optional, can be nil)
Returns:
- *Service: the Service instance
- error: an error if the data source or driver name is empty
func (*Service) Connect ¶ added in v0.7.3
Connect opens the database connection
Parameters:
- ctx: the context
Returns:
- error: an error if the connection could not be opened
func (*Service) GetLastSyncTokensUpdatedAt ¶ added in v0.7.3
GetLastSyncTokensUpdatedAt gets the last sync tokens updated at timestamp
Parameters:
- ctx: the context
Returns:
- time.Time: the last sync tokens updated at timestamp
- error: an error if the timestamp could not be retrieved
func (*Service) UpdateLastSyncTokensUpdateAt ¶ added in v0.7.3
UpdateLastSyncTokensUpdateAt updates the last sync tokens updated at timestamp
Parameters:
- ctx: the context
- updatedAt: the new timestamp
Returns:
- error: an error if the timestamp could not be updated
Click to show internal directories.
Click to hide internal directories.