Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
67985484
Commit
67985484
authored
Nov 21, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DDC-1502 - Add support for prefixed database table names in SQLite by replacing the . with __
parent
e692ab66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
SqlitePlatform.php
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+11
-0
No files found.
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
View file @
67985484
...
@@ -291,6 +291,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -291,6 +291,7 @@ class SqlitePlatform extends AbstractPlatform
*/
*/
protected
function
_getCreateTableSQL
(
$name
,
array
$columns
,
array
$options
=
array
())
protected
function
_getCreateTableSQL
(
$name
,
array
$columns
,
array
$options
=
array
())
{
{
$name
=
str_replace
(
"."
,
"__"
,
$name
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
$autoinc
=
false
;
$autoinc
=
false
;
...
@@ -338,16 +339,19 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -338,16 +339,19 @@ class SqlitePlatform extends AbstractPlatform
public
function
getListTableConstraintsSQL
(
$table
)
public
function
getListTableConstraintsSQL
(
$table
)
{
{
$table
=
str_replace
(
"."
,
"__"
,
$table
);
return
"SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = '
$table
' AND sql NOT NULL ORDER BY name"
;
return
"SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = '
$table
' AND sql NOT NULL ORDER BY name"
;
}
}
public
function
getListTableColumnsSQL
(
$table
,
$currentDatabase
=
null
)
public
function
getListTableColumnsSQL
(
$table
,
$currentDatabase
=
null
)
{
{
$table
=
str_replace
(
"."
,
"__"
,
$table
);
return
"PRAGMA table_info(
$table
)"
;
return
"PRAGMA table_info(
$table
)"
;
}
}
public
function
getListTableIndexesSQL
(
$table
,
$currentDatabase
=
null
)
public
function
getListTableIndexesSQL
(
$table
,
$currentDatabase
=
null
)
{
{
$table
=
str_replace
(
"."
,
"__"
,
$table
);
return
"PRAGMA index_list(
$table
)"
;
return
"PRAGMA index_list(
$table
)"
;
}
}
...
@@ -411,6 +415,7 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -411,6 +415,7 @@ class SqlitePlatform extends AbstractPlatform
*/
*/
public
function
getTruncateTableSQL
(
$tableName
,
$cascade
=
false
)
public
function
getTruncateTableSQL
(
$tableName
,
$cascade
=
false
)
{
{
$tableName
=
str_replace
(
"."
,
"__"
,
$tableName
);
return
'DELETE FROM '
.
$tableName
;
return
'DELETE FROM '
.
$tableName
;
}
}
...
@@ -500,4 +505,10 @@ class SqlitePlatform extends AbstractPlatform
...
@@ -500,4 +505,10 @@ class SqlitePlatform extends AbstractPlatform
{
{
return
'BLOB'
;
return
'BLOB'
;
}
}
public
function
getTemporaryTableName
(
$tableName
)
{
$tableName
=
str_replace
(
"."
,
"__"
,
$tableName
);
return
$tableName
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment