mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
API CHANGE: addslashes function
This commit is contained in:
parent
d89cfb89ca
commit
e1add0138e
@ -831,6 +831,13 @@ class PostgreSQLDatabase extends Database {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the SQL command to get all the tables in this database
|
||||
*/
|
||||
function allTablesSQL(){
|
||||
return "select table_name from information_schema.tables where table_schema='public' and table_type='BASE TABLE';";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return enum values for the given field
|
||||
* @todo Make a proper implementation
|
||||
@ -839,6 +846,15 @@ class PostgreSQLDatabase extends Database {
|
||||
return array('SiteTree','Page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Because NOW() doesn't always work...
|
||||
* MSSQL, I'm looking at you
|
||||
*
|
||||
*/
|
||||
function now(){
|
||||
return 'NOW()';
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a SQLQuery object into a SQL statement
|
||||
* @todo There is a lot of duplication between this and MySQLDatabase::sqlQueryToString(). Perhaps they could both call a common
|
||||
@ -881,6 +897,14 @@ class PostgreSQLDatabase extends Database {
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/*
|
||||
* This will return text which has been escaped in a database-friendly manner
|
||||
* Using PHP's addslashes method won't work in MSSQL
|
||||
*/
|
||||
function addslashes($value){
|
||||
return pg_escape_string($value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user