Git Product home page Git Product logo

Comments (5)

dimitri avatar dimitri commented on August 18, 2024

I think I will need more details, like a reproductible complete test-case, because my testing here shows no problem:

CL-USER> (cl-csv:read-csv-row "C:\\some\\nasty\\windows\\path\\,foo"
                              :separator #\,
                              :quote #\"
                              :escape "\\\"")
("C:\\some\\nasty\\windows\\path\\" "foo")
CL-USER> (cl-csv:read-csv-row "C:\\some\\nasty\\windows\\path\\"
                              :separator #\,
                              :quote #\"
                              :escape "\\\"")
("C:\\some\\nasty\\windows\\path\\")

See the test/ directory for easy self-contained examples using the FROM inline syntax.

Also, in your case, did you notice that you can actually directly connect pgloader to the MySQL source and load from a database connection?

from pgloader.

fpauser avatar fpauser commented on August 18, 2024

I was trying to use CSV because I have to load the data (only) from mysql to postgres and the CSV-source gives me the possibility to configure the table/column mapping between source and target (e.g. 'user.userid' => 'users.id').

I don't think that this is possible with the mysql-source, or at least I did not find any options to specify the table/column-mapping between mysql and postgres. I can specify a specific table, I can say 'data only', and I can cast types by column - but I cannot configure the actual mapping. Or did I miss something?

from pgloader.

dimitri avatar dimitri commented on August 18, 2024

You can speficy the mapping using a MySQL View on top of your current data model, then have pgloader only migrate the views. Easier way to do that is create a new schema in MySQL and have all the views in there, as they will be able to refer to the main tables in the main schema.

See the clause MATERIALIZE VIEWS where you can name the views you want to migrate the content of.

from pgloader.

fpauser avatar fpauser commented on August 18, 2024

Nice workflow - thanks for your hints!
For the CSV-Problem - I'll have a look and come back with a more detailed error-explanation.

from pgloader.

fpauser avatar fpauser commented on August 18, 2024

Closing this for now as I lost my failing pgloader-script and cannot provide more details to reproduce the csv-reading error.

from pgloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.