puppetlabs/puppetlabs-mysql

Documentation out of date for mysql::db sql parameter

kreczko opened this issue · 3 comments

Describe the Change You Would Like

Following current examples and documentation leads to an error:

Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Mysql::Db[apel]: parameter 'sql' expects a value of type Undef or Array, got String

→ documentation related to the sql parameter is incorrect.

manifests/db.pp

# @param sql
#   The path to the sqlfile you want to execute. This can be an array containing one or more file paths.

→ needs to be an array of one or more files (or undef) - not sure about correct phrasing.

README.md

mysql::db { 'mydb':
  ...
  sql             => '/path/to/sqlfile.gz',
  ...
}

needs to be

mysql::db { 'mydb':
  ...
  sql             => ['/path/to/sqlfile.gz'],
  ...
}

Hey @kreczko thank you for highlighting this issue, this has been an oversight on our end and I will work on resolving it. Our code is dynamically documented in the REFERENCE.md therefore is usually more up to date. I have created a PR to address this issue, again thank you for taking the time to raise this issue #1517

@pmcmaw np, happy to help. After all, this is a very useful module :).

Our code is dynamically documented in the REFERENCE.md therefore is usually more up to date

Missed that one. I assume it is taking the info directly from the module docs since it references the same sentence: "The path to the sqlfile you want to execute.".
While the type is mentioned, the above sentence can easily be misinterpreted (path != array).

Fix has now been merged :-) Im going to close this issue.
If you are waiting on a release just let me know. 👍