Repository navigation
feat(plugin-cassandra): list user-defined types, offer them in the type picker and drop them - #3719
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
system_schema.types. Opening one shows its fields and a rebuiltCREATE TYPE, with Open in Editor.frozen<…>when a plain column cannot hold it: a field is a non-frozen collection, the server predates 3.6, or it is ScyllaDB (reports 3.0.8). Names are quoted like Cassandra'smaybeQuote, plus CQL type names, so a type called"text"is never spelled as the nativetext.DROP DOMAINfor a domain), SQL Server. The gate shows the statement and confirms it as destructive; the server's refusal while a table or type still uses it is shown as is. Hidden on read-only connections.PluginUserDefinedTypeKind.udt("User-Defined Type", CQL's word, as feat(plugin-mssql): browse SQL Server alias, table and CLR types #2856 did for SQL Server) andgenerateDropTypeSQL(type:)defaulting to nil. MCPlist_typesacceptskind: "udt";UserDefinedTypeToolSchemaTestsis updated for it.CassandraObjectQueries.elements(of:)no longer trims spaces and quotes off list elements, which renamed a field or argument such as"customer'".apple/scripts/probes/check-cassandra-user-types.shruns the type code against a live server.3719.added.md,3719.added.1.md,3719.fixed.md,3719.fixed.1.md.Test plan
UserTypeDroppingTests, new: the drop runs on the scope's pooled driver, a denial runs nothing, a cancel stays a cancel, the adapter forwards the type,Supportlists droppable kinds.DatabaseTreeMenuSpecTests,UserDefinedTypeInfoTests,PluginMetadataRegistryCuratedCapabilityTests(Cassandra and ScyllaDB browse types before the plugin loads),PostgreSQLTypeQueryTests: fail onmain, pass here. 190 tests in the touched suites pass;AllPluginsbuilds.CREATE TYPEround-trips, including names with quotes, spaces and commas; each picker spelling is accepted and is the type ("text"and"byte"included); the bare name is refused wherever the spelling is frozen;DROP TYPEis refused while in use and runs once nothing uses the type. Not run against ScyllaDB or Cassandra 3.x/4.x.Not in this PR
contactholdingfrozen<phone>, or a PostgreSQL composite over a later domain) is created before its dependency and the restore stops there (SQLExportPlugin.writeObjectCreatePhase, sorted by(dumpOrder, name)).Docs: TableProApp/docs#76
Fixes #2528