Hello guys, if you're using Windows, you can use sqlc inside a Docker container: docs.sqlc.dev/en/latest/overview/install.html#docker And generate code using this command: docker run --rm -v $(pwd):/src -w /src kjconroy/sqlc generate I think you will need to replace the $(pwd) with your current folder because it's kind of volume mapping.
@mustafaemin73893 жыл бұрын
Open powershell in your project directory then paste that: docker run --rm -v ${pwd}:/src -w /src kjconroy/sqlc generate That worked on my system.
@cariyaputta2 жыл бұрын
I'm on Windows 11 and facing another issues, any idea on this: project-folder> docker run --rm -v :/src -w /src kjconroy/sqlc generate error parsing sqlc.json: file does not exist make: *** [Makefile:17: sqlc] Error 1
@cariyaputta2 жыл бұрын
I have resolved it. The issue is that when run it inside make, it will ignore the ${pwd} part If some one run into this issue with the Makefile. add these lines into your file: makeFileDir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) sqlc: docker run --rm -v $(makeFileDir):/src -w /src kjconroy/sqlc generate
@mfc11902 жыл бұрын
@@cariyaputta Thanks, this was helpful!
@thorfinnthegoatmc2 жыл бұрын
@@mustafaemin7389 Thank you so much bro
@jarriabidi14384 жыл бұрын
this is gold. i have been very confused about how to add type safety to my db code while maintaining performance and not learning a ton of new syntax. this sqlc thing is amazing
@TECHSCHOOLGURU4 жыл бұрын
yes, it's really is amazing :)
@Dzikrullah_999 Жыл бұрын
you are a talented and patient teacher. The world is better with you Tech School !
@CiroSilvano-yn7ow Жыл бұрын
Thank you for this amazing content! I'd like to add that the pq driver is less maintained and hence may not be the best choice anymore. After following the lecture I migrated to pgx version 4, which is now well supported by sqlc (v5 is still experimental).
@vonmutinda48884 жыл бұрын
Even with months of writing Go code, I still find these videos super useful. Would you kindly touch on Design Patterns in later videos. Thanks.
@TECHSCHOOLGURU4 жыл бұрын
Thanks von. Great suggestion, I will try to make some videos about it in the future.
@berkekaancetinkaya87213 жыл бұрын
Following this with a windows machine is a nightmare :) Besides the series is awesome!!
@vedantshinde22773 жыл бұрын
Did you manage to get it running? I'm getting an error while executing this command: "docker run --rm -v C:/Users/vedant/src -w /src kjconroy/sqlc generate" It either says that "error parsing sqlc.json: file does not exist" or schema.sql doesn't exist.
@berkekaancetinkaya87213 жыл бұрын
@@vedantshinde2277 No i have found an another solution which is switching to Linux 😂
@MrVirusbkhn4 жыл бұрын
i found new horizon, all of your tutorial which exactly is my orientation. Thank for your effort, hope you will product quality videos, like this :D
@TECHSCHOOLGURU4 жыл бұрын
Glad I could help!
@sekirandahamza12603 жыл бұрын
I feel sad that such an informative video (series) has over 13989 views and just few likes. Like the damn video, it's the only payment you're going to make for this free awesome information. Thanks TECH SCHOOL ,keep it up.
@TECHSCHOOLGURU3 жыл бұрын
Thanks a lot, Sekiranda!
@AdityaFingerstyle3 жыл бұрын
18:16, rows.Close() is already deferred and then called again.
@TECHSCHOOLGURU3 жыл бұрын
nice catch :D
@GmanGavin1 Жыл бұрын
Wow, I'm very surprised by how informative this video is.
@TECHSCHOOLGURU Жыл бұрын
Glad you think so!
@dwiwahyudi9698 Жыл бұрын
Hi, Thanks for the video, this really help me a lot. Btw, For parameters (CreateAccountParams, etc...), Are there any reason not used parameters in models.go (Account, Entry, etc..) like Account models object in return, ex: > func (q * Queries) CreateAccount(ctx context.Context, arg Account) (Account, error) Because, I already try to use Account models as input and return for CreateAccount function, and the result is still the the same. Thanks.
@budipr64482 жыл бұрын
Hi, I was trying it and got this message : the PostgreSQL engine does not support Windows. Any advice would be appreciated, thanks
@Saulsotog3 жыл бұрын
this series of videos are really great
@TECHSCHOOLGURU3 жыл бұрын
Thanks, Saul Soto!
@hoonj2500 Жыл бұрын
Nice utilization of Makefile
@shellixupdates61252 жыл бұрын
If you should not edit the generated files manually, then how do you use `json:",omitempty"` with sqlc ?
@orkhanrustamli20392 жыл бұрын
Hey, great tutorial as always. Question, in my work usually db comes with pre defined schema which is defined by db engineers which means I do no have schema at hand to feed sqlc. What would be your approach in this case?
@TECHSCHOOLGURU2 жыл бұрын
Hey Orkhan, I think sqlc automatically queries the database to know its schema. You can give it a try and please let me know if it's not the case.
@orkhanrustamli20392 жыл бұрын
@@TECHSCHOOLGURU I could not find property to show database address so that sqlc will try to fetch schema from db. I think this is the only major downside of sqlc,
@user-sk4nt5bm5r Жыл бұрын
Could you update this to reflect sqlc version 2 config file? It is quite different. Thanks for the course btw. I think v2 sqlc.yaml should look like this: version: "2" sql: - schema: "./db/migration/" queries: "./db/query/" engine: "postgresql" gen: go: package: "db" emit_json_tags: true out: "./db/sqlc"
@AhmedAli-jx9ie Жыл бұрын
up
@aliadel1723 Жыл бұрын
Thank you bro
@apoorvamishra5952 Жыл бұрын
slqc.yaml is different in the latest version 1.17.2 and with lesser options
@rishabhagrawalzra2 жыл бұрын
Hi @TECH SCHOOL, what is the meaning of context.Context, and why we are passing this. Can you pls elaborate on this? Thanks loved your content
@TECHSCHOOLGURU2 жыл бұрын
We use context to control the lifetime of a process, so we can easily stop processing if the context has been canceled. For example, if the client calls your API and only waits for 1 second, but your API takes 5 seconds to complete => then after 1 second, the client has already canceled the request => so the server can stop working on it immediately.
@MorbidPasta2 жыл бұрын
@@TECHSCHOOLGURU lol that's the easiest way i've ever heard someone explain it, thanks for that.
@Mona001-01g2 жыл бұрын
Are there any pre requisite video to this lesson 4 video that I can follow to understand the file contents of files generated with sqlc generate command?
@panggilmeiam11 ай бұрын
Damn bro! Thank you very much!!! I learn a lot!
@toledot Жыл бұрын
sqlc v1.20.0 on MacOS will not generate the file named "account.sql.go". Is it correct? or do I do anything wrong?
@apramaysingh1291 Жыл бұрын
You have to add comments above your query file's instruction like so: #Here the "-- name: createUser' is the name of the function and ":one" indicates a returning of a single schema INSERT into users ( username, hashed_password, full_name, email ) VALUES ( ?1, ?2, ?3, ?4 ) RETURNING *; This way SqlC know how to actually generate the function
@nityanandagohain41543 жыл бұрын
hands down, this is amazing. Thank you for making this
@TECHSCHOOLGURU3 жыл бұрын
Glad you liked it!
@pakersmuch37054 ай бұрын
Love it! Thanks.
@kyphanquoc6824 Жыл бұрын
I wonder a extension for .sql file of your vscode? I try install some extensions but it don't work (ex: SQL SERVER (mssql), Prettier SQL VSCODE). Please, help me :^^
@robertommmin5 Жыл бұрын
Gold Mine! Thank you
@afiqurrahman2884 Жыл бұрын
I found this problem the postgresql engine requires cgo.please set CGO_ENABLED=1. I try export in makefile but still same
@HelloWorld-tn1tl Жыл бұрын
version 2 is preferred now.
@DrPanesar3 жыл бұрын
Hi, I've used sqlc for the first time. I wonder can you use it to write your one more complex SQL statements such as If and multicolon operations. It does not build go functions then using the sqlc generate command. I wonder if you can write it manually and then have sqlc run your own function / code?
@TECHSCHOOLGURU3 жыл бұрын
Hi Paramjit, sqlc can generate code for many different types of complex queries. You can try it on your own to see if it works for your specific case or not. In case it doesn't work, you can always write your own code using the standard db/sql library, and use it together with other functions generated by sqlc.
@budi05802 жыл бұрын
You should add sqlboiler into the list
@ThapakornTantirattanapong Жыл бұрын
MySQL is now usable?
@tradealert38022 жыл бұрын
Why not use sqlc to also handle the creation of the tables rather than using go migrate? Is there a way to also do migration with sqlc
@TECHSCHOOLGURU2 жыл бұрын
Each tool has its own purpose. Sqlc was not designed to run DB migrations.
@akashrajvanshi6362 Жыл бұрын
What is diff btw this playlist and udemy course???
@TECHSCHOOLGURU Жыл бұрын
Hi Akash, Several people have asked this question in Tech School's discord server. discord.com/invite/BksFFXu Here's my answer: The content is the same. The only difference is, there are ads on KZbin videos, and on Udemy you will get a certificate of completion if you finish the course. I created Tech School with the purpose of providing free education, so anyone who can't afford to buy the course can still learn for free on KZbin. A lot of students who already watched youtube videos also purchased the course on Udemy as a way of supporting my mission.
@LewisFlorezRenza3 ай бұрын
I can't installed on Windows, I got a message about dll library is not found. any solution?
@mcgam3r_tv809 Жыл бұрын
Amazing thanks brother!
@Llanilek2 жыл бұрын
How do you nest foreign key data into the sql query?
@viktorkot9922 жыл бұрын
for windows docker run --rm -v "%cd%:/src" -w /src kjconroy/sqlc
@TECHSCHOOLGURU2 жыл бұрын
Thank you!
@idirdev37294 жыл бұрын
Thanks for these great videos, Could you Pls show us the best way to make a bulk insert?
@TECHSCHOOLGURU4 жыл бұрын
Great suggestion, Idir! I will try to make a video about it in the future.
@Nexjsdeveloper2 жыл бұрын
Worth as gold. I don't now how can i thank you
@TECHSCHOOLGURU2 жыл бұрын
Thank you! You can support us by liking & sharing the videos, or buy us a coffee. ^^
@pol3na8 ай бұрын
Did anyone have issue with installing sqlc on linux? installed it using snap, when i typed sqlc version it said that command not found.
@xerofit13973 жыл бұрын
Hi Quang, thanks for the vid! sqlc is really amazing. I have a question though, when we're writing a query for generating sqlc code that involves more than one table and requires a join let's say table A and B, where is the best practice to store that query? A.sql, B.sql, or create a new A-B.sql (Sorry if the example lacks in context, I can't think of a real case). Thank you!
@TECHSCHOOLGURU3 жыл бұрын
Hi Xerofit, I think where to store the query might depend on the context of the use-case. If the data you're querying is more of A (and just some additional data from B), then you can put it in A.sql (and vice-versa) For some specific use-case, you might even put the query in its own separate file if you want.
@xerofit13973 жыл бұрын
@@TECHSCHOOLGURU Thank you!
@introvert96394 жыл бұрын
Sqlc doc doesn't says about writing native queries or complex queries including multiple table joins etc. ....any idea?
@TECHSCHOOLGURU4 жыл бұрын
Good question! You can write any complex queries and generate code for it with sqlc. For example: -- name: GetEntryWithAccount :one SELECT e.*, a.owner, a.balance FROM entries as e JOIN accounts as a ON e.account_id = a.id WHERE e.id = $1 LIMIT 1;
@hafizmfadli2 жыл бұрын
this is amazing course !!!!!!!!!!!!
@TECHSCHOOLGURU2 жыл бұрын
Thank you!
@muhammadsesay74872 жыл бұрын
This is very amazing.
@devfun30323 жыл бұрын
Hey bro. Sqlc release version 1.10. Now, What should version use? Thanks
@TECHSCHOOLGURU3 жыл бұрын
Hey, I think you can go with the latest version.
@ddlelo84894 жыл бұрын
Please make video to create a REST API continuing this process
@TECHSCHOOLGURU4 жыл бұрын
Sure, Elo. Coming up next week!
@rizkimuntohary73502 жыл бұрын
Thankyou this is amazing
@TECHSCHOOLGURU2 жыл бұрын
Thank you!
@jeremyjohns96154 жыл бұрын
How much would be the difference if we use sqlx instead of sqlc? Because I am facing issues while installing sqlc on my computer (using Windows 10 Home). Can we still follow your tutorial while using sqlx?
@TECHSCHOOLGURU4 жыл бұрын
Hi Jeremy, you can use sqlx if you want. The only difference is that if you use sqlx then you have to implement all the CRUD yourself, while if you use sqlc then they're automatically generated for you. If you have docker running on your Windows machine, then you can try this to generate sqlc code with docker run: github.com/kyleconroy/sqlc#docker docker run --rm -v $(pwd):/src -w /src kjconroy/sqlc generate
@jeremyjohns96154 жыл бұрын
@@TECHSCHOOLGURU if the only difference is implementing the CRUD functionality, I will give it a go when I give up installing sqlc. I have pulled an image using docker pull, but when I run the docker run command, it shows an error. Do you need to replace "pwd" command with something else while running docker run?
@TECHSCHOOLGURU4 жыл бұрын
Sorry I don't have a Windows machine so I don't know. It seems like developing on a Windows machine is not very easy. So perhaps you can try to switch to linux or mac instead?
@parvineyvazov2 жыл бұрын
You can run like this: docker run --rm -v "%cd%:/src" -w /src kjconroy/sqlc generate
@sajirmohd3 жыл бұрын
I didnt have error even without 'go mod init' Why we are initializing go mod then?
@TECHSCHOOLGURU3 жыл бұрын
Hi Sajir, That's a good question! The command `go mod init` creates a `go.mod` file to keep track of all external modules that your project depends on. So if you don't have any dependencies, then you probably don't need it. Besides, if you're writing a library module (like an open-source library for example), then it's very important that you run `go mod init` with a valid path from which your module can be downloaded by Go tools. You can read more about how to create a module here: golang.org/doc/tutorial/create-module
@daryalazareva96643 жыл бұрын
Hi! Thanks for the videos, they're amazing! I have an error while running 'sqlc init': Error: open sqlc.yaml: permission denied. Does anyone know how to fix it?
@daryalazareva96643 жыл бұрын
it helped to use sqlc inside a container running command docker run --rm -v $(pwd):/src -w /src kjconroy/sqlc init using ubuntu by the way
@faizulla5838 Жыл бұрын
Author is hear ? How work without GORM?
@milanpanic3755Ай бұрын
is this out of date in 08 Oct 2024 ?
@jcolindres0012 жыл бұрын
Hi Sir, Excellent training! Do you know a tool / library like sqlc for generating graphql in go? Regards, JA
@pawelprusinski52513 жыл бұрын
So it sounds that best way (speed) is to use std library and do 4 functions for CRUD.
@TECHSCHOOLGURU3 жыл бұрын
Yeah, the best way for speed is to use sqlc to generate code that use standard db/sql package. We can also combine sqlc with other package like db/sql or db/sqlx for some cases that sqlc cannot generate codes (because the query is too complex for example)
@connorjcantrell3 жыл бұрын
@@TECHSCHOOLGURU This is an interesting concept. I am curious to see an example of this
@huunam1001 Жыл бұрын
I have problem when query LIKE OR ILIKE with SLQC. Is any body here to help me. Other, I wonder if SQLC use normal SQL statement?
@TECHSCHOOLGURU Жыл бұрын
Yes, you can use LIKE or ILIKE as normal query. If you want to discuss more, feel free to join Tech School's Discord group to chat directly with me and other student: bit.ly/techschooldc
@XuanQuynhLexuanquynh3 жыл бұрын
thank for sharing.
@TECHSCHOOLGURU2 жыл бұрын
Thank you for watching!
@bishanrasaili72462 жыл бұрын
After I write the query file and run the command 'sqlc generate', I get the error simple_bank\db\migration\000001_init_schema.up.sql:1:1: the PostgreSQL engine does not support Windows. Can someone please help me resolve this issue ?
@TECHSCHOOLGURU2 жыл бұрын
Hi Bishan, Some of my students have successfully generated the code using sqlc on Windows with this approach: - Setup WSL and run the linux binary of sqlc like you would normally run an executable. docs.microsoft.com/en-us/windows/wsl/install-win10 Maybe you can give it a try? Or another approach using docker: First, pull the sqlc image. docker pull kjconroy/sqlc Then run the specific commands in the PowerShell as follows: docker run --rm -v ${pwd}:/src -w /src kjconroy/sqlc version docker run --rm -v ${pwd}:/src -w /src kjconroy/sqlc init docker run --rm -v ${pwd}:/src -w /src kjconroy/sqlc generate
@namhuynh1264 жыл бұрын
R u Vietnamese. Thank u a lot for this video. It help me so much.
@TECHSCHOOLGURU4 жыл бұрын
Yes I am. Thank you, Nam!
@TheSatyrical2 жыл бұрын
For Window users: if other options don't work, try downloading WSL2 kzbin.info/www/bejne/jH69eWyGn5eXjtk Make sure to redownload (onto WSL2) Go, GCC, and make. You can use Go to install sqlc and everything should work. Also, you can download windows terminals (the base WSL2 terminal isn't good). And try out zsh.
@TECHSCHOOLGURU2 жыл бұрын
Thanks a lot for the tip, Atropolith!
@nitishsaini9722 жыл бұрын
But on windows, only MySQL is available and when you run sqlc generate it tells postgres not available for windows, any solution for that
@michaelumeokoli2 жыл бұрын
@@nitishsaini972 I'm facing this same issue
@phongnguyenthanh9577 Жыл бұрын
How to close database connection after done
@TECHSCHOOLGURU Жыл бұрын
Hi Phong, As per documentation of the database/sql package, we don't have to close the db connection: pkg.go.dev/database/sql#Open "The returned DB is safe for concurrent use by multiple goroutines and maintains its own pool of idle connections. Thus, the Open function should be called just once. It is rarely necessary to close a DB."
@edarha71834 жыл бұрын
how to create connection pool between golang and sql?
@TECHSCHOOLGURU3 жыл бұрын
Hi Edar Ha. That's a good question! Actually when you use the standard database/sql package, there's already a basic connection pool implemented under the hood. There are several methods you can use to control the number of connections and their lifetime, such as db.SetMaxIdleConns(N), db.SetMaxOpenConns(N), db.SetConnMaxLifetime(duration) I will definitely make a video about this in one of the lecture. For now, you can read more about it here: go-database-sql.org/connection-pool.html www.alexedwards.net/blog/configuring-sqldb golang.org/pkg/database/sql/#DB.SetConnMaxIdleTime
@edarha71833 жыл бұрын
@@TECHSCHOOLGURU yep, thanks for your reply. What are you think about mongodb and driver mongodb in golang?
@angnat05 Жыл бұрын
Got an error error, generating code: source error: 99:14: expected ';', found sql (and 1 more errors) , thanks for kind help
@TECHSCHOOLGURU Жыл бұрын
Hi @angnat, I can't help without seeing your codes first. Can you share your codes on a GitHub repo? And perhaps you can join Tech School's discord channel to chat directly with me and other students: discord.com/invite/BksFFXu It's faster and much more convenient to communicate than KZbin comments.
@angnat05 Жыл бұрын
@@TECHSCHOOLGURU sure, would you mind to share invitation to discord?
@TECHSCHOOLGURU Жыл бұрын
yeah it's the link i posted in the previous comment: discord.com/invite/BksFFXu
@sajirt20693 жыл бұрын
After installing sqlc (verified with 'sqlc version'), i tried 'sqlc init' inside the project folder and i am getting an error, user@user-HP-Laptop-15-db0xxx:~/Projects/go-simplebank$ sqlc init Error: open : no such file or directory How to fix this?
@TECHSCHOOLGURU3 жыл бұрын
Hi Sajir, This is really strange. I've never faced this error before. What version of sqlc are you using?
@sajirt20693 жыл бұрын
@@TECHSCHOOLGURU Thanks for the response sqlc version: v1.7.0 Also i didnt have error without 'go mod init' Why we are doing it?
@TECHSCHOOLGURU3 жыл бұрын
Hey Sajir, I'm using slqc 1.6.0, so maybe there's something different. But someone pointed out in other comment that it may work if you run: sqlc init -f "sqlc.yaml" Maybe it's worth a try! Regarding your question about go mod init, I also answered in other comment, but will repost it again here: The command `go mod init` creates a `go.mod` file to keep track of all external modules that your project depends on. So if you don't have any dependencies, then you probably don't need it. Besides, if you're writing a library module (like an open-source library for example), then it's very important that you run `go mod init` with a valid path from which your module can be downloaded by Go tools. You can read more about how to create a module here: golang.org/doc/tutorial/create-module
I used database/sql in my project if anyone with windows dont try to use sqlc it does not work what ever you do it works only with mysql and that's not a good idea to use experimental thing
@TECHSCHOOLGURU3 жыл бұрын
I don't think what you said is true. SQLC works for Postgres, no mater if you're on Windows or not. You can try using Docker on Windows to generate the code: docs.sqlc.dev/en/latest/overview/install.html#docker
@mechtarin3 жыл бұрын
@@TECHSCHOOLGURU i have tried it gave me this error the PostgreSQL engine does not support Windows I used docker with docker run --rm -v ${pwd}:/src -w /src kjconroy/sqlc generate
@vedantshinde22773 жыл бұрын
-- name: ListTransfers :many SELECT * FROM transfers WHERE from_account_id = $1 OR to_account_id = $2 ORDER BY id LIMIT $3 OFFSET $4; filtering using 'AND' keyword instead of 'OR' would make more sense, no? -- name: ListEntries :many SELECT * FROM entries WHERE account_id = $1 ORDER BY id LIMIT $2 OFFSET $3; Is it okay if the entries are ordered in descending order of account_id?
@TECHSCHOOLGURU3 жыл бұрын
1. It depends on the use case. If you just want to list all transfers from account 1 to account 2 then use AND. In this case, I want to list all transfers of the same account (either going in or out), so I use OR, and if you look at the TestListTransfer function, you will see that I pass the same account ID into the function. 2. This query list all entries of 1 specific account (in the WHERE clause), so it doesn't make sense to order by account id, since there is only 1 account ID in the result, right?
@vedantshinde22773 жыл бұрын
@@TECHSCHOOLGURU Sorry, I meant order by created_at in a descending fashion.
@davidontiveros28953 жыл бұрын
ughhh crap. Got stuck until this point. Using Windows 😥
@TECHSCHOOLGURU3 жыл бұрын
Hi David, have you tried using Linux Subsystem on Windows 10? docs.microsoft.com/en-us/windows/wsl/install-win10
@davidontiveros28953 жыл бұрын
@@TECHSCHOOLGURU yes, actually I kept reading and saw the docker comment. So I am running sqlc on a container. It works fine. Thanks for replying and btw your videos are top notch! Congratulations!
@vedantshinde22773 жыл бұрын
@@davidontiveros2895 Hey... I'm getting an error while executing this command: "docker run --rm -v C:/Users/vedant/src -w /src kjconroy/sqlc generate" It either says that "error parsing sqlc.json: file does not exist" or schema.sql doesn't exist. I can barely find any help on forums and the documentation just sums it up in a line. Any help would be appreciated
@davidontiveros28953 жыл бұрын
@@vedantshinde2277 I ended up using the linux binary of sqlc like techschool mentioned. If you are running Windows you can setup WSL and run the binary like you would normally run an executable.
@vedantshinde22773 жыл бұрын
@@davidontiveros2895 I did that exact thing and it worked like a charm! Thank you!!
@mannerism62863 жыл бұрын
Has anyone come across 'panic: runtime error: invalid memory address or nil pointer dereference' after running make sqlc?
@bobnicholson10113 жыл бұрын
I have the same problem and cannot figure out what’s causing it. It occurs on “sqlc generate”. I’m on a mac trying to use 1.8 sqlc.
@mannerism62863 жыл бұрын
@@bobnicholson1011 i think you should check typos in the fields. My issue was the typo.
@bobnicholson10113 жыл бұрын
@@mannerism6286 I figured it out. Somehow I had commas at the end of my migration file names. It appears that it did not affect the migrations. But, it seems to cause a problem for "sqlc generate”. Thanks to your response, I continued looking.
@buacomgiadinh14 жыл бұрын
Please make text bigger, thank you
@TECHSCHOOLGURU4 жыл бұрын
Hi Ha Do, Thanks for the suggestion. It's quite readable to my eyes. Can you try to watch the video in HD or 4K to see if it's clearer to you?
@buacomgiadinh14 жыл бұрын
TECH SCHOOL thank you for your answer, i use smart tv and iPhones to watch your video. Thank you for your great work
@jeremyjohns96154 жыл бұрын
Did someone successfully installed sqlc on Windows? (using Windows 10 Home)
@TECHSCHOOLGURU4 жыл бұрын
Perhaps you can try running sqlc with docker: github.com/kyleconroy/sqlc#docker
@vedantshinde22773 жыл бұрын
Did you manage to get it running? I'm getting an error while executing this command: "docker run --rm -v C:/Users/vedant/src -w /src kjconroy/sqlc generate" It either says that "error parsing sqlc.json: file does not exist" or schema.sql doesn't exist.
@kzm6944 жыл бұрын
source code on github??
@TECHSCHOOLGURU4 жыл бұрын
Hi Bardia, it's in the description: github.com/techschool/simplebank
@mechtarin3 жыл бұрын
the PostgreSQL engine does not support Windows yeey
@visa22563 жыл бұрын
yo I am having this prob rn lol
@TECHSCHOOLGURU3 жыл бұрын
Hi guys, I think you can try using Docker to generate the code: docs.sqlc.dev/en/latest/overview/install.html#docker
@mechtarin3 жыл бұрын
@@TECHSCHOOLGURU i tried it does not work
@davidle57114 жыл бұрын
Hi is sqlc not supported on Windows ? the first time I run go get github.com/kyleconroy/sqlc/cmd/sqlc it was okay. But when I run go install github.com/kyleconroy/sqlc/cmd/sqlc I got the error lfittl\pg_query_go\parser\include/port.h:17:10: fatal error: netdb.h: No such file or directory Anyone encounter the same error as me ?
@TECHSCHOOLGURU4 жыл бұрын
Hi Leong, can you try to run sqlc using docker run as described here? github.com/kyleconroy/sqlc/#docker
@jeremyjohns96154 жыл бұрын
@@TECHSCHOOLGURU I have pulled an image using docker pull, but when I run the docker run command, it shows an error. Do you need to replace "pwd" command with something else while running docker run?
@vedantshinde22773 жыл бұрын
Did you manage to get it running? I'm getting an error while executing this command: "docker run --rm -v C:/Users/vedant/src -w /src kjconroy/sqlc generate" It either says that "error parsing sqlc.json: file does not exist" or schema.sql doesn't exist.
@until_4ever3624 жыл бұрын
sqlc does not support windows, unhappy
@TECHSCHOOLGURU4 жыл бұрын
Hi Ezzz, sqlc is written in Go, so I'm pretty sure it can run on Windows. Can you try to install it using go get? go get github.com/kyleconroy/sqlc/cmd/sqlc Otherwise, you can still run it within a docker container: github.com/kyleconroy/sqlc#docker docker pull kjconroy/sqlc docker run --rm -v $(pwd):/src -w /src kjconroy/sqlc generate
@until_4ever3624 жыл бұрын
@@TECHSCHOOLGURU go get or use git clone for go build,the same error: No such file or directory
@TECHSCHOOLGURU4 жыл бұрын
How about run it with docker? docker run --rm -v $(pwd):/src -w /src kjconroy/sqlc generate Or perhaps try to build a binary of sqlc from source github.com/kyleconroy/sqlc#building, then use it to generate the codes?
@namhuynh1264 жыл бұрын
U can try wsl2 for window. Wsl2 is very simple for install and it strong right now. I don't have install dual os anymore.
@LarryWEitel3 жыл бұрын
Has anyone resolves sqlc not running on windows?
@michaelumeokoli2 жыл бұрын
Hello I keep getting this # package bankdb C:\Users\user\Desktop\GO-STUFF\BANK-APP\db\migration\000001_init_schema.up.sql:1:1: the PostgreSQL engine does not support Windows
@TECHSCHOOLGURU2 жыл бұрын
Hi Mikey, On Windows, you can run sqlc using Docker as suggested in their documentation page: docs.sqlc.dev/en/latest/overview/install.html#docker
@aliadel1723 Жыл бұрын
anyone facing the problem of error parsing sqlc.yaml: yaml: unmarshal errors: line 2: field packages not found in type config.Config make: *** [Makefile:19: sqlc] Error 1 sloving with: version: "2" sql: - schema: "./db/migration/" queries: "./db/query/" engine: "postgresql" gen: go: package: "db" emit_json_tags: true out: "./db/sqlc" and makeFileDir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) sqlc: docker run --rm -v $(makeFileDir):/src -w /src kjconroy/sqlc generate
@BasicInfo-gg1lo3 ай бұрын
my all query is running but insert query is not running what I do if am unable to make account