<commit_before>component extends="Abstract" {

	variables.sqlTypes = {};
	variables.sqlTypes['biginteger'] = {name='BIGINT UNSIGNED'};
	variables.sqlTypes['binary'] = {name='BLOB'};
	variables.sqlTypes['boolean'] = {name='TINYINT',limit=1};
	variables.sqlTypes['date'] = {name='DATE'};
	variables.sqlTypes['datetime'] = {name='DATETIME'};
	variables.sqlTypes['decimal'] = {name='DECIMAL'};
	variables.sqlTypes['float'] = {name='FLOAT'};
	variables.sqlTypes['integer'] = {name='INT'};
	variables.sqlTypes['string'] = {name='VARCHAR',limit=255};
	variables.sqlTypes['text'] = {name='TEXT'};
	variables.sqlTypes['time'] = {name='TIME'};
	variables.sqlTypes['timestamp'] = {name='TIMESTAMP'};
	variables.sqlTypes['uuid'] = {name='VARBINARY', limit=16};

	/**
  * name of database adapter
  */
	public string function adapterName() {
		return "MySQL";
	}

	/**
	* generates sql for primary key options
	*/
	public string function addPrimaryKeyOptions(required string sql, struct options = {}) {
		if (StructKeyExists(arguments.options, "null") && arguments.options.null) {
			arguments.sql = arguments.sql & " NULL";
		} else {
			arguments.sql = arguments.sql & " NOT NULL";
		}
		if (StructKeyExists(arguments.options, "autoIncrement") && arguments.options.autoIncrement) {<commit_msg>add addForeignKeyOptions function. fixes #862 (#934)<commit_after>component extends="Abstract" {

	variables.sqlTypes = {};
	variables.sqlTypes['biginteger'] = {name='BIGINT UNSIGNED'};
	variables.sqlTypes['binary'] = {name='BLOB'};
	variables.sqlTypes['boolean'] = {name='TINYINT',limit=1};
	variables.sqlTypes['date'] = {name='DATE'};
	variables.sqlTypes['datetime'] = {name='DATETIME'};
	variables.sqlTypes['decimal'] = {name='DECIMAL'};
	variables.sqlTypes['float'] = {name='FLOAT'};
	variables.sqlTypes['integer'] = {name='INT'};
	variables.sqlTypes['string'] = {name='VARCHAR',limit=255};
	variables.sqlTypes['text'] = {name='TEXT'};
	variables.sqlTypes['time'] = {name='TIME'};
	variables.sqlTypes['timestamp'] = {name='TIMESTAMP'};
	variables.sqlTypes['uuid'] = {name='VARBINARY', limit=16};

	/**
  * name of database adapter
  */
	public string function adapterName() {
		return "MySQL";
	}

	public string function addForeignKeyOptions(required string sql, struct options = {}) {
		arguments.sql = arguments.sql & " FOREIGN KEY (" & arguments.options.column & ")";
		if (StructKeyExists(arguments.options, "referenceTable")){
			if (StructKeyExists(arguments.options, "referenceColumn")){
				arguments.sql = arguments.sql & " REFERENCES ";
				arguments.sql = arguments.sql & arguments.options.referenceTable;
				arguments.sql = arguments.sql & " (" & arguments.options.referenceColumn & ")";
			}
		}
		return arguments.sql;
	}

	/**
	* generates sql for primary key options
	*/
	public string function addPrimaryKeyOptions(required string sql, struct options = {}) {
		if (StructKeyExists(arguments.options, "null") && arguments.options.null) {
			arguments.sql = arguments.sql & " NULL";
		} else {
			arguments.sql = arguments.sql & " NOT NULL";
		}
		if (StructKeyExists(arguments.options, "autoIncrement") && arguments.options.autoIncrement) {
{'fraction_non_alphanumeric': 0.17970737913486004, 'fraction_numerical': 0.0057251908396946565, 'mean_word_length': 5.649048625792812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5376876', 'n_tokens_mistral': 1038, 'n_tokens_neox': 984, 'n_words': 177}