// NewStore creates a fresh instance of the store.
// Last parameter specifies how often should the inactive users' cleanup
// operation execute. 0 disables cleanup.
NewStore creates a fresh instance of the store.
Last parameter specifies how often should the inactive users' cleanup
operation execute. 0 disables cleanup.
// NewStore creates a fresh instance of the store . // Last parameter specifies how often should the inactive users ' cleanup // operation execute . 0 disables cleanup .
func NewStore(log zerolog.Logger, db *sqlx.DB, d time.Duration) (*Store, error) {
	s := &Store{log: log, db: db}
	if err := s.initSQL(); err != nil {
		return nil, err
	}
	if _, err := s.q.Exec(db, "create_users_table"); err != nil {
		return nil, err
	}
	go s.startCleanup(d)
	return s, nil
}
func NewStore ( log zerolog . Logger , db * sqlx . DB , d time . Duration ) ( * Store , error ) { s := & Store { log : log , db : db } if err := s . initSQL ( ) ; err != nil { return nil , err } if _ , err := s . q . Exec ( db , " " ) ; err != nil { return nil , err } go s . startCleanup ( d ) return s , nil }
NewStore creates a fresh instance of the store.
NewStore creates a fresh instance of the store .
// unlikely to happen