Skip to content
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

Backslashes in Enum Values not possible. #1572

Open
theTigerDuck opened this issue Apr 8, 2024 · 0 comments
Open

Backslashes in Enum Values not possible. #1572

theTigerDuck opened this issue Apr 8, 2024 · 0 comments

Comments

@theTigerDuck
Copy link

I have a Database of a SilverStripe Project that puts Fulle qualified Classnames in an enum.

First a changed pgsql-ddl.lisp and added in line 171: (setf default (cl-ppcre:regex-replace-all "\\" default "\\\\")).
The Result is that it can create the Table but I still got an Error with the Values.

Secound approach I put in transforms.lisp:
(defun fix-enum-backslashes (string)
"Transform \ to \"
(when string
(if (search "\\" string)
string
(setf string (cl-ppcre:regex-replace-all "\" string "\\\\"))))
string)

And then in my-cast-rules.lisp
(:source (:type "enum")
:target (:type ,#'enum-or-set-name)
:using pgloader.transforms::fix-enum-backslashes)

This was teoretically working. But all my tablenames and columnes are lowercase. So I have to use --with "quote identifiers". Now all my Enum Values have double backslashes like SilverStripe\ErrorPage\ErrorPage. So I redone all my changes because it seems with "quote identifiers" they are not neccesary anymore. Now I get the same Error form the biginning. Cant even create the Table.
ERROR Database error 22P02: invalid input value for enum "ChangeSet_ClassName": "SilverStripe\Versioned\ChangeSet"

Im not a lisp programmer. I have no idea what I'm doing.

PS: How the f*ck do I end that debuger? Only solution is kill -9 in another terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant