-
Notifications
You must be signed in to change notification settings - Fork 2
Path prefix fixes, directory exists fix, SqlServer compability #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
trusek
wants to merge
1
commit into
WebGardenGroup:main
Choose a base branch
from
trusek:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
create table flysystem_files | ||
( | ||
id bigint identity primary key, | ||
path nvarchar(255) not null, | ||
type nvarchar(4) not null, | ||
contents varbinary(max), | ||
size int default 0 not null, | ||
level int not null, | ||
mimetype nvarchar(127), | ||
visibility nvarchar(7) default 'public' not null, | ||
timestamp int default 0 not null | ||
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace WGG\Flysystem\Doctrine\Tests; | ||
|
||
use Doctrine\DBAL\DriverManager; | ||
use League\Flysystem\AdapterTestUtilities\FilesystemAdapterTestCase; | ||
use League\Flysystem\FilesystemAdapter; | ||
use WGG\Flysystem\Doctrine\DoctrineDBALAdapter; | ||
|
||
use function dirname; | ||
|
||
/** | ||
* @covers \WGG\Flysystem\Doctrine\DoctrineDBALAdapter | ||
*/ | ||
class DoctrineDBALAdapterWithPrefixTest extends FilesystemAdapterTestCase | ||
{ | ||
protected static function createFilesystemAdapter(): FilesystemAdapter | ||
{ | ||
$connection = DriverManager::getConnection([ | ||
'url' => 'sqlite:///:memory:', | ||
]); | ||
|
||
$connection->executeStatement((string) file_get_contents(dirname(__DIR__).'/schema/sqlite.sql')); | ||
|
||
return new DoctrineDBALAdapter(connection: $connection, prefix: 'prefix_test'); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXISTS already a boolean operator in SQL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but for mssql that is inncorect syntax. You can check this on (https://sqliteonline.com/)
throws: Token error: 'Incorrect syntax near the keyword 'exists'.'
When on Sqlite, PostgreSql, MariaDb, Mysql works like a charm.
Case-When syntax should work on every engine.
But on Oracle still missing
from DUAL
. On this could be patched with simpleThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getDummySelect wont work. E.g.: DB2.
Currently the bundle supports: sqlite, mysql , mariadb and pgsql.
If we need to add more platform, a refactor is needed to handle platform-specific queries i guess. Not just some if-else in the adapter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package is great, I just miss support for SQLserver.I'm not intrested with others like Oracle or DB2.
I'm not familiar with DB2. Doctrine do
sprintf('SELECT %s FROM sysibm.sysdummy1', $expression);
for this platform.