Comments (1)
From my understanding of mapping types, types and comments...
mapping_types
are rules used by DBAL to convert SQL types to DBAL types.types
are rules used by DBAL to convert DBAL types into PHP Types (or better, to choose a converter that maps "SQL data" to PHP types/data).
as example:
- postgres
bigserial
is converted into DBAL'sbigint
(thanks to built inmapping_types
) - DBAL's
bigint
is later converted in PHP'sstring
(thanks to built intypes
)
Thus in your case i would expect something as:
mapping_types:
vector: LLPhantVectorType
types:
LLPhantVectorType: LLPhant\Embeddings\VectorStores\Doctrine\VectorType
The fact that your implementation of VectorType
returns an array
is is unknown to doctrine.
The comment is used to infer a Doctrine type when there are multiple doctrine types mapped on the same SQL type. The classical example is:
Consider an SQL type varchar(255)
, that type can be used as the Php's string
, MyEnum
(a backed enum that uses strings as cases) or any PHP type that can be serialized into a string with max 255 chrs.
When DBAL encounters a vector
SQL type, needs to decide which DBAL Type assign to it. If a comment is found, it will try to find that type, if not it will find a default.
You might have configs defined as follows:
mapping_types:
vector: LLPhantVectorType
types:
LLPhantVectorType: LLPhant\Embeddings\VectorStores\Doctrine\VectorType
GoetasVectorType: GoetasVectorType
In this case, both GoetasVectorType
and LLPhant\Embeddings\VectorStores\Doctrine\VectorType
want to use a SQL vector, but DBAL needs to a way to decide which type to instantaite when an SQL column of type vector
is found.
GoetasVectorType
will have to override requiresSQLCommentHint
. Columns that use GoetasVectorType
will have a comment, columns that use LLPhant\Embeddings\VectorStores\Doctrine\VectorType
will not.
When DBAL finds an SQL vector
type will check for a comment, when found will try to instantiate the type in the comment. If no comment is found, will try to instantiate the type defined in the configs.
from doctrinemigrationsbundle.
Related Issues (20)
- Bug: comparaison metadata of table `doctrine_migration_versions` fail with doctrine/orm": "^2.6.4 HOT 1
- The metadata storage is not up to date (because of platformOptions?) HOT 2
- Doctrine Migration Bundle runs its own checks for the Messenger component? HOT 3
- make:migration dont create AUTO_INCREMENT on some entity
- Wrong migration for columnDefinition for DATETIME
- One-To-One Self-referencing is being ignored for PostgreSQL HOT 3
- generate idempotent sql migration script
- Generated columns added to migrations file every time - any way to tell the migration to ignore single fields? HOT 2
- Migrations regenerates DROP CONSTRAINT and ADD the same CONSTRAINT HOT 2
- Symfony deprecation HOT 2
- Add option --mapping on migrations:diff
- Wrong SQL generated for MySQL when using TEXT type with unique index
- `TableMetadataStorage->complete` generates invalid SQL for Oracle when applying a new migration HOT 1
- Doctrine migrations generates DROP CONSTRAINT twice
- option --em does nothing for me HOT 1
- Migrations run out of chronological order if you have multiple namespaces defined
- Support Symfony 7 HOT 1
- Migration dependency injection in Symfony 7.0 HOT 7
- compatible with latest Doctrine ORM 3 and DBAL 4? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrinemigrationsbundle.