You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
659 B

  1. #lang racket
  2. (require db
  3. redis)
  4. (provide connect-redis
  5. connect-sql
  6. redis-conn
  7. mysql-conn)
  8. ;; This should be a racket parameter
  9. (define (connect-redis)
  10. (make-redis))
  11. (define redis-conn (make-parameter (connect-redis)))
  12. (define sql-user (getenv "SQL_USER"))
  13. (define sql-pass (getenv "SQL_PASSWORD"))
  14. (unless (and sql-user sql-pass)
  15. (error "provide SQL user information with SQL_USER and SQL_PASSWORD environment variables"))
  16. (define (connect-sql)
  17. (mysql-connect #:user sql-user
  18. #:password sql-pass
  19. #:database "db_webqtl_s"))
  20. (define mysql-conn (make-parameter (connect-sql)))