Skip to content

Instantly share code, notes, and snippets.

@cwarden
Created December 4, 2011 18:23
Show Gist options
  • Select an option

  • Save cwarden/1430903 to your computer and use it in GitHub Desktop.

Select an option

Save cwarden/1430903 to your computer and use it in GitHub Desktop.
# mysql::client would provide access to a database for mysql::record
mysql::client { 'my_database':
host => 'example.com',
database => 'database_name',
username => 'user',
password => 'password'
}
# this would ensure that the query
# SELECT field_1, field2 FROM my_database.my_table WHERE table_id = 'my key'
# returns a single row with "field 1 value" and "field 2 value"
mysql::record {
database => 'my_database',
table => 'my_table',
primary_key => 'table_id',
fields => {
'table_id' => 'my key',
'field_1' => 'field 1 value',
'field_2' => 'field 2 value',
'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment