
var Value = require ('./value');

/**
 * The equivalent of a SQL value.
 **/
module.exports = new Class
({
	Extends: Value
	,Tag: 'sql-search-tags'

	,render: function (batch)
	{
		if (typeof this._value == 'string')
		{
			var value = this._value.replace (/^|\s+|$/g, '%');
			return "'" + value.replace (this.regexp, this.replaceFunc) + "'";
		}
		else
			return this.parent ();
	}
});
