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

File line by line #318

Open
gedw99 opened this issue Apr 1, 2023 · 4 comments
Open

File line by line #318

gedw99 opened this issue Apr 1, 2023 · 4 comments

Comments

@gedw99
Copy link

gedw99 commented Apr 1, 2023

In the readme it says it can read files line by line.

this seems to be the code:

https://github.com/cube2222/octosql/tree/main/datasources/lines

I wonder if this might match my use cases.

i need to query and subscribe to file changes of text files in a folder.

the text files are old format and not the point .

I don’t want to query against the contents of these text files but rather be notifies when a files changes and what line it was and what the old and new line is.

@cube2222
Copy link
Owner

cube2222 commented Apr 11, 2023

@gedw99 Hey!

octosql won't actually show you which line changes as it changes; it basically works like tail -f.

@gedw99
Copy link
Author

gedw99 commented Apr 29, 2023

Ah thanks @cube2222

I have gotten something working that does tell me what kind changed , give me a diff and allows me to them patch .

It’s useful for being able to do mutations on json or csv.

If you want I can PR it in as it’s own cmd. It has basic tests.

@cube2222
Copy link
Owner

I'm not sure if having a separate cmd makes too much sense here (unless you mean plugin) but I'd love to see a screenshot / code if it's open source @gedw99!

@gedw99
Copy link
Author

gedw99 commented Apr 30, 2023

It’s open source bits ..

Let me pull it together and pt on my GitHub .

it uses unified diff that’s the code of git but it’s all golang.

That allows you to do a CQRS / cdc style pattern off a file such that a change event diff can be created and then used for patching on the other side .

The line number is part of the unified diff and created for you.

Kind of makes sense ? It’s a different way to skin this cat as they say

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

2 participants