pub struct EmptyDatamodelConnector;
Expand description

A Connector implementor meant to be used as a default when no datasource is defined.

Trait Implementations§

source§

impl Connector for EmptyDatamodelConnector

source§

fn provider_name(&self) -> &'static str

The name of the provider, for string comparisons determining which connector we are on.
source§

fn name(&self) -> &str

The name of the connector. Can be used in error messages.
source§

fn referential_actions(&self) -> BitFlags<ReferentialAction>

The referential actions supported by the connector.
source§

fn capabilities(&self) -> BitFlags<ConnectorCapability>

The static list of capabilities for the connector.
source§

fn max_identifier_length(&self) -> usize

The maximum length of constraint names in bytes. Connectors without a limit should return usize::MAX.
source§

fn available_native_type_constructors(&self) -> &'static [NativeTypeConstructor]

Returns all available native type constructors available through this connector. Powers the auto completion of the VSCode plugin.
source§

fn scalar_type_for_native_type( &self, _native_type: &NativeTypeInstance ) -> ScalarType

Returns the default scalar type for the given native type
source§

fn default_native_type_for_scalar_type( &self, _scalar_type: &ScalarType ) -> Option<NativeTypeInstance>

On each connector, each built-in Prisma scalar type (Boolean, String, Float, etc.) has a corresponding native type.
source§

fn native_type_is_default_for_scalar_type( &self, _native_type: &NativeTypeInstance, _scalar_type: &ScalarType ) -> bool

Same mapping as default_native_type_for_scalar_type(), but in the opposite direction.
source§

fn native_type_to_parts( &self, _native_type: &NativeTypeInstance ) -> (&'static str, Vec<String>)

Debug/error representation of a native type.
source§

fn parse_native_type( &self, name: &str, _: &[String], span: Span, diagnostics: &mut Diagnostics ) -> Option<NativeTypeInstance>

This function is used during Schema parsing to calculate the concrete native type.
source§

fn validate_url(&self, _url: &str) -> Result<(), String>

source§

fn flavour(&self) -> Flavour

The database flavour, divergences in database backends capabilities might consider us to use a different flavour, like in the case of CockroachDB. However other databases are less divergent as to consider sharing a flavour with others, like Planetscale and MySQL or Neon and Postgres, which respectively have the Mysql and Postgres flavours.
source§

fn is_provider(&self, name: &str) -> bool

Must return true whenever the passed in provider name is a match.
source§

fn has_capability(&self, capability: ConnectorCapability) -> bool

Does the connector have this capability?
source§

fn allowed_relation_mode_settings(&self) -> BitFlags<RelationMode>

The relation modes that can be set through the relationMode datasource argument.
source§

fn default_relation_mode(&self) -> RelationMode

The default relation mode to assume for this connector.
source§

fn emulated_referential_actions(&self) -> BitFlags<ReferentialAction>

The referential actions supported when using relationMode = “prisma” by the connector. There are in fact scenarios in which the set of emulated referential actions supported may change depending on the connector. For example, Postgres’ NoAction mode behaves similarly to Restrict (raising an error if any referencing rows still exist when the constraint is checked), but with a subtle twist we decided not to emulate: NO ACTION allows the check to be deferred until later in the transaction, whereas RESTRICT does not.
source§

fn allows_set_null_referential_action_on_non_nullable_fields( &self, _relation_mode: RelationMode ) -> bool

Most SQL databases reject table definitions with a SET NULL referential action referencing a non-nullable field, but that’s not true for all of them. This was introduced because Postgres accepts data definition language statements with the SET NULL referential action referencing non-nullable fields, although this would lead to a runtime error once the action is actually triggered.
source§

fn supports_composite_types(&self) -> bool

source§

fn supports_named_primary_keys(&self) -> bool

source§

fn supports_named_foreign_keys(&self) -> bool

source§

fn supports_named_default_values(&self) -> bool

source§

fn supports_referential_action( &self, relation_mode: &RelationMode, action: ReferentialAction ) -> bool

source§

fn scalar_filter_name( &self, scalar_type_name: String, _native_type_name: Option<&str> ) -> Cow<'_, str>

This is used by the query engine schema builder. Read more
source§

fn string_filters(&self, input_object_name: &str) -> BitFlags<StringFilter>

This is used by the query engine schema builder. It is only called for filters of String fields and aggregates. Read more
source§

fn validate_native_type_arguments( &self, _native_type: &NativeTypeInstance, _scalar_type: &ScalarType, _span: Span, _: &mut Diagnostics )

Validate that the arguments passed to a native type attribute are valid.
source§

fn validate_enum(&self, _enum: Walker<'_, EnumId>, _: &mut Diagnostics)

source§

fn validate_model( &self, _model: Walker<'_, ModelId>, _: RelationMode, _: &mut Diagnostics )

source§

fn validate_relation_field( &self, _field: Walker<'_, RelationFieldId>, _: &mut Diagnostics )

source§

fn validate_datasource( &self, _: BitFlags<PreviewFeature>, _: &Datasource, _: &mut Diagnostics )

source§

fn validate_scalar_field_unknown_default_functions( &self, db: &ParserDatabase, diagnostics: &mut Diagnostics )

source§

fn constraint_violation_scopes(&self) -> &'static [ConstraintScope]

The scopes in which a constraint name should be validated. If empty, doesn’t check for name clashes in the validation phase.
source§

fn find_native_type_constructor( &self, name: &str ) -> Option<&NativeTypeConstructor>

source§

fn supports_scalar_lists(&self) -> bool

source§

fn supports_enums(&self) -> bool

source§

fn supports_json(&self) -> bool

source§

fn supports_json_lists(&self) -> bool

source§

fn supports_auto_increment(&self) -> bool

source§

fn supports_non_id_auto_increment(&self) -> bool

source§

fn supports_multiple_auto_increment(&self) -> bool

source§

fn supports_non_indexed_auto_increment(&self) -> bool

source§

fn supports_compound_ids(&self) -> bool

source§

fn supports_decimal(&self) -> bool

source§

fn supported_index_types(&self) -> BitFlags<IndexAlgorithm>

source§

fn supports_index_type(&self, algo: IndexAlgorithm) -> bool

source§

fn allows_relation_fields_in_arbitrary_order(&self) -> bool

source§

fn should_suggest_missing_referencing_fields_indexes(&self) -> bool

If true, the schema validator function checks whether the referencing fields in a @relation attribute are included in an index.
source§

fn native_type_to_string(&self, instance: &NativeTypeInstance) -> String

source§

fn native_instance_error( &self, instance: &NativeTypeInstance ) -> NativeTypeErrorFactory

source§

fn datamodel_completions( &self, _db: &ParserDatabase, _position: SchemaPosition<'_>, _completions: &mut CompletionList )

source§

fn datasource_completions( &self, _config: &Configuration, _completion_list: &mut CompletionList )

source§

fn parse_datasource_properties( &self, _args: &mut HashMap<&str, (Span, &Expression)>, _diagnostics: &mut Diagnostics ) -> DatasourceConnectorData

source§

fn parse_json_datetime( &self, _str: &str, _nt: Option<NativeTypeInstance> ) -> Result<DateTime<FixedOffset>, ParseError>

source§

fn parse_json_bytes( &self, _str: &str, _nt: Option<NativeTypeInstance> ) -> Result<Vec<u8>, ConversionFailure>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.