Guest User

Untitled

a guest
Aug 26th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. plugins:
  2. Database:
  3. driver: 'mysql'
  4. database: 'testdtb'
  5. host: '127.0.0.1'
  6. port: 3306
  7. username: 'test'
  8. password: 'localhost'
  9. connection_check_threshold: 10
  10. dbi_params:
  11. RaiseError: 1
  12. AutoCommit: 1
  13. on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ]
  14. log_queries: 1
  15.  
  16. my $users = database->quick_select('users', { id => params->{id} });
  17.  
  18. session: "DatabasePlugin"
  19.  
  20. engines:
  21. session:
  22. DatabasePlugin:
  23. connection: "foo"
  24. session_table: "SESSIONS"
  25. id_column: "SESSION_ID"
  26. data_column: "SESSION_DATA"
  27.  
  28. plugins:
  29. Database:
  30. connections:
  31. foo:
  32. driver: "SQLite"
  33. database: "foo.sqlite"
  34.  
  35. my $foo_dbh = database('foo');
  36. my $users = database->quick_select('users', { id => params->{id} });
  37.  
  38. Then, you can call the database keyword with the name of the database connection you want, for example:
  39. my $foo_dbh = database('foo');
  40. my $bar_dbh = database('bar');
Add Comment
Please, Sign In to add comment