When it all GOes right
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 542 | |
Author | ||
Contributors | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/61929 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
FOSDEM 2023406 / 542
2
5
10
14
15
16
22
24
27
29
31
36
43
48
56
63
74
78
83
87
89
95
96
99
104
106
107
117
119
121
122
125
126
128
130
132
134
135
136
141
143
146
148
152
155
157
159
161
165
166
168
170
173
176
180
181
185
191
194
196
197
198
199
206
207
209
210
211
212
216
219
220
227
228
229
231
232
233
236
250
252
256
258
260
263
264
267
271
273
275
276
278
282
286
292
293
298
299
300
302
312
316
321
322
324
339
341
342
343
344
351
352
354
355
356
357
359
369
370
372
373
376
378
379
380
382
383
387
390
394
395
401
405
406
410
411
413
415
416
421
426
430
437
438
440
441
443
444
445
446
448
449
450
451
458
464
468
472
475
476
479
481
493
494
498
499
502
509
513
516
517
520
522
524
525
531
534
535
537
538
541
00:00
Software developerWorld Wide Web ConsortiumService (economics)WordPoint (geometry)Information technology consultingCybersexBranch (computer science)Software developerData miningFerry CorstenClient (computing)DiagramComputer animation
01:47
Computing platformComputer programProduct (business)Cross-platformCompilerText editorFormal languageBinary codeSoftware developerWordProjective planeDevice driverComputing platformExtension (kinesiology)Archaeological field surveyComputer architecturePhysical systemVirtual machineContinuous integrationComputer animation
04:06
Game theoryFormal languageDatabaseElectronic data processingProjective planeProduct (business)WebsiteSoftware frameworkComputer animation
05:03
CodeProjective planePlug-in (computing)Operator (mathematics)Formal languageDebuggerGoodness of fitNear-ringWebsiteCartesian coordinate systemIntegrated development environmentSoftware repositoryComputer animation
06:51
Virtual machineGoodness of fitSoftware developerWeb browserOpen sourceDevice driverBinary codeObject-relational mappingFunction (mathematics)FreewareUtility softwareFamilyParsingSoftware testingTable (information)Mereology
09:16
DatabaseDevice driverLevel (video gaming)Object-relational mappingObject (grammar)Multiplication signDatabaseGoodness of fitGraph (mathematics)Asynchronous Transfer ModeData structureSoftware maintenanceImplementationProjective planeFunctional (mathematics)Computer animation
11:00
Multiplication signStatisticsDiagram
11:53
DatabaseCommunications protocolDatabaseType theoryDefault (computer science)HookingConnected spaceObject (grammar)CASE <Informatik>Software developerData structureCuboidRight angleOpen setDifferent (Kate Ryan album)LoginInterface (computing)Standard deviationProjective planeWrapper (data mining)Formal languageLevel (video gaming)Binary codeLibrary (computing)Heat transferUniqueness quantificationPower (physics)Computer animation
15:21
Revision controlOrder of magnitudeTerm (mathematics)Computer animation
16:08
Inversion (music)Limit (category theory)Connected spaceWrapper (data mining)Queue (abstract data type)Data structureDatabaseMereologyProjective planeStandard deviationNumberLibrary (computing)Multiplication signPoint (geometry)Different (Kate Ryan album)CoroutineThread (computing)Computer animation
18:16
Error messageQuery languageExtension (kinesiology)DatabaseSemantics (computer science)Interface (computing)Programmable read-only memoryFunctional (mathematics)Projective planeCASE <Informatik>Data structureRow (database)Multiplication signProgram slicingDatabaseExtension (kinesiology)Revision controlGame controllerComputer animation
20:18
Product (business)StrutQuery languageRange (statistics)String (computer science)Error messageRow (database)Field (computer science)ResultantData structureFunctional (mathematics)Position operatorComputer animation
21:09
Software testingServer (computing)Software testingInstallation artServer (computing)Cartesian coordinate systemCommunications protocolRow (database)Real numberIntegrated development environmentIntegerDatabaseLibrary (computing)Thermal expansionFamilyImplementationStatement (computer science)CodeLevel (video gaming)Computer animation
24:12
Error messageView (database)Set (mathematics)Turbo-CodeElectronic program guideGradientGamma functionProduct (business)Interface (computing)Position operatorCASE <Informatik>Right angleCodeInsertion lossObject (grammar)Cartesian coordinate systemSoftware testingDatabase transactionStatement (computer science)Connected spaceExpected valuePointer (computer programming)Row (database)Error messageQuadrilateralParameter (computer programming)MathematicsResultantRepository (publishing)Functional (mathematics)Data structureLie groupComputer animationPanel painting
29:26
Schmelze <Betrieb>Line (geometry)WaveInformation securityFunctional (mathematics)Repository (publishing)Revision controlCartesian coordinate systemSoftware testingContinuous integrationCuboidBinary codeCASE <Informatik>Projective planeMedical imagingComputer fileWeb browserSource codeFunction (mathematics)CodeGroup actionLine (geometry)Vulnerability (computing)Multiplication signFreewareElectronic mailing list
33:41
Broadcast programmingRevision controlModul <Datentyp>Directory serviceGroup actionValue-added networkMaxima and minimaGroup actionMilitary baseCartesian coordinate systemTraffic reportingComputing platformSoftware developerMultiplication signPhysical systemMedical imagingMathematicsDifferent (Kate Ryan album)Process (computing)CodeGeneric programmingDependent and independent variablesBitWindowSoftwareSlide ruleAuthorizationFunctional (mathematics)Library (computing)Repository (publishing)Asynchronous Transfer ModeCore dumpConfiguration spaceComputer architectureBlogComputer fileQuicksortSoftware testingBinary codeInterface (computing)BuildingOrder (biology)ResultantRight angleRevision controlData structureField (computer science)Computer animation
42:12
Broadcast programmingGroup actionRevision controlModulo (jargon)Limit (category theory)Directory serviceError messageProduct (business)Execution unitStrutQuery languageRange (statistics)String (computer science)Virtual machineRow (database)DatabaseServer (computing)Field (computer science)Functional (mathematics)InformationData structureCommunications protocolCASE <Informatik>Connected spaceGraphical user interfaceDevice driverSoftwareComputer animation
44:52
Term (mathematics)CubeCompilerArithmetic progressionTerm (mathematics)Library (computing)Medical imagingJava appletSoftware bugStandard deviationScaling (geometry)Group actionSoftware testingRevision controlExtension (kinesiology)Data managementField (computer science)Device driverInstance (computer science)Strategy gameSoftware maintenanceComputer animation
48:46
Program flowchart
Transcript: English(auto-generated)
00:07
Everybody we are starting, please be quiet Couple of things first of all, welcome Here I am to introduce our next speaker Pablo in our PostgreSQL Devroom who's gonna talk about to go Just a few practical things
00:22
When you exit, please exit from the back and if you want to go out in between the talk Please be quiet because this Devroom is very loud and these chairs are very freaky. So Yes, that being said enjoy
00:46
Hello people How are you today was yesterday fun? Because first two talks were not really crowded but mine is It's good already
01:00
Yeah, my name is Pablo Golub. I'm working for cyber tech So I'm a senior consultant in a body of a young developer So Today well a couple of words about my company cyber deck is purely PostgreSQL company
01:21
We work with clients only if they have PostgreSQL If they don't we install it and they can work with us from that point we are We are having several branches all over not all over but you know the world some of them in
01:42
South America, most of them are in Europe Not now Want to restart so some of our customers so choose your fighter Some of our products so we are not only consulting people but we do products
02:07
So Yeah, why PostgreSQL, you know why it's cool absolutely So what I'm what will be I'm talking about today, so first of all I want to introduce you to the go language. How many of you have an idea what the go language is?
02:26
Okay, so I don't need like start from the Beginning explaining what the compiler is and etc. So yeah, okay then I will Say a couple words about ideas and editors. We are using
02:42
Then I will describe drivers for PostgreSQL specifically Some useful extensions How we do testing how we do releases how we do continuous integration development, etc And then probably I hope we'll have a question session
03:06
Okay, so why go first of all when I when I start my first project I Like the go produces the native one binary for every platform
03:22
Is it Wow? Wow, I just can build everything From the same command line for every previous system and architecture I want to and I don't need virtual machines and other crap just like go It's simple enough
03:42
It has a good community It's it now has already very comprehensive tools support by github gitlab, etc, etc Yeah So cross-platform is somehow connected with the native binaries for every architecture
04:05
So this is the last developer survey for go asking How people are using go language for what kind of so Speaking about postgres. I would say the data processing is somehow connected before that we
04:25
had like these answers where you can see that databases is like a half of the projects people were using
04:41
Probably, you know, if not, so the top products written go are kubernetes and docker OpenShift Then Hugo the fastest framework for billion statistical sites etc, etc, etc
05:03
Postgres related go put products which I know postgres related which are written in go Is are the cockroach DB? Both postgres operators from Zalando and from crunchy
05:21
wall G PG Center or PG watch PG timetable so on and so on. So if you want to find more projects more applications written in go Please go to this Site to this repo. There are a lot of them a lot of them
05:42
Okay, so what about tooling? Because when I was started I used sublime text There were there was there was no proper IDE to work with no debugger No, no, no these kind of things
06:00
right now according to the last year developer, sorry the most The most used IDE is VS code Then go land by jet brains and then beam near beam and sublime text is 1% I
06:22
Was I was saying at the conference that it took that I will try go land and will tell you about How it is different from VS code? No Still still didn't try it, but I think it's good. So these These are the answers from the previous years
06:40
So as you can see the intention is the same so this code and top and your language And etcetera etcetera go land What I'm using I'm using this code with the official plugin installed Then I'm using the T parse command-line
07:02
Utility to make this fancy tables out of test output Um Linter of course tip 9 I tried to get lab co-pilot It's not bad, but I don't want to spend my money on this. I have my own head, you know
07:24
Go release there to produce the packages and binaries like in in one go then post SQL of course and The last but at least the git pod IO which is Pretty much the same thing as a github workspace
07:43
But it's free for open source developers So it's good if you want to try something new and you don't want to install Everything on your machine or to set up the virtual machine. You can go there run it in your browser Drinking beer on the beach and trying something new, right?
08:02
It's okay. If you're done, you just closed your brother or brother close your tab and it's gone Now About drivers about the post SQL part of the stock the whole idea of the stock
08:20
started after after I Tried to find a good tutorials about how to start to work with post SQL a lot of them not all of them, but a lot of them say Okay, just use ORM and you're fine well
08:41
Well, why if I need to like to create utility to use like three comments, right? Why should I use like ORM? And yeah, don't get me wrong ORMs are fine. If you know we're doing what you know what you are doing They solve the problems
09:01
but you you don't need to put it everywhere and You don't need to start from it Because otherwise you will be learning ORM but not learning post SQL itself, right? Yeah We have SQL for that
09:23
So During this talk I will not be explaining ORMs and how to work with that. I will explain the basic drivers Anyway, ORMs are using drivers on the low level to speak to the post SQL, right? So we should know how to use them
09:42
So The thing is in Go that we have these databases SQL interfaces Interfaces is just like an agreement on what methods are available from I don't know from object from structure or whatever and
10:02
For Each database There should be a special driver and implementation for this interface, right? So the first official implementation for the post SQL in the Go world was libpq
10:22
It's good It's proven it It's a long time on the market but it is in maintenance mode right now for two years Probably it's not bad. It's okay You can be sure that this functionality is
10:40
solid But if you want more and if you start a new project Jackcpgx is the way to go Because You can use it with whatever you want. I will show you later So yeah, we are scientists and we do graphs
11:04
so unlike of Python or not a Python but NPM JavaScript work we don't have this statistic for How many times particular package was? Downloaded use whatever so the most
11:21
Funny way is to use github stars And yeah to build the this stuff so as you can see The pjx is one year Started one year later But now it's going to be very popular. So in
11:44
2019-20 There was an announcement that the libpq is going to maintain small and the pjx started to grow So what if you are if your project is using already database SQL or you want to follow tutorials or
12:03
techniques and to use this database SQL standard de facto interfaces for that purpose pjx has a special wrapper so You can still use database SQL interface
12:20
but you can Underneath on the low level you will use the pjx package So you should use pjx solely if you are starting a new project or and your project is Aiming only possible SQL right then you don't need the database SQL
12:43
But if you are like dependent on or or you are dependent on other package Which want you to use the database SQL right you go for wrapper In that case the dependency will use this wrapper to
13:02
Speak to the database SQL and you will use the power of pjx So there are a lot of unique features that are not present Not implemented in the standard library and they cannot be implemented because this interface is
13:23
Common is the same for every possible database. So for example, you cannot add methods With the copy support to because only PostgreSQL do copy support, right? so the most The most cool features is that pjx supports
13:43
Binary transfer protocol and it supports natively all built-in Postgres types and If you create user types It will support Them out of the box Unless they are very complicated, but even in that case you can create a special interface or a special
14:06
Object structure that will tell pjx how to encode decode the developers of your types So as I said, yeah copy protocol Logging
14:21
Yeah, and for connection pooling you you have this after connect hook so the idea in go language is that the the database object that you have is Pool by default so it can like create additional connections and you never know how many active well
14:42
you can know but you can never tell how many connections you have right now and this for example after connect who helps you to Prepare your session prepare your new open connection for something like add some identifier login or whatever
15:03
Yeah, listen not if I is implemented natively What else yeah Different JSON hstore large objects So everything you need is already there
15:21
Nice thing about pjx is the in December probably the new major version 5 Release Was and and and it was a huge step forward Especially in the term of dependencies v4 version 4
15:45
was Good, but it has so many external dependencies That for example magnitude under said no We will not rewrite our internal tool into pjx because it's too much
16:02
Dependencies, it's not the thing anymore and it's very cool So yeah, hello world you probably all know how to do to write it in the database SQL with the device SQL interface, so you're just
16:21
Using that import package and but instead of using Leap the queue you are Specifying pjx as the delete which is the wrapper for the for the standard library And then all things are the same no difference
16:41
No difference. So if you want to update your project You just change the import part the import of leap pq to the pjx Standard leap and you are fine If you want use pjx directly you are
17:01
You're fine to do that the thing is The thing is here that the pjx return The connect with that return the one connection only So if you don't need a pool of connections, or if you want to be sure that only one
17:21
Connection is alive one connection is used you are going with pjx connect, right? But please remember that you cannot use this structure this connection In parallel so you need to to know that One point in time only on the one thread or one go routine can talk to the database
17:46
Otherwise, you're good but if you want a pool of connections you are going with pjx pool and I don't know What can I add here? It's obvious. Yeah, it's pulling you can you can pass it to the go routines
18:05
And it will create additional connections as you go and you can limit upper number of connections Etc, etc. It's very very very flexible Okay about useful extensions
18:21
For my first project I started With the leap pq as well It's way to go that's how we grow and Later, I understand that I want this copy functionality badly I need that So I started to look to the pjx how to switch it
18:43
and I I Didn't want to lose this SQL things When you're encoding decoding your structures slices arrays, whatever Right from rows or two rows, right? That's what most people
19:04
Think the ORM do it just translates the rows into the structures But yeah, it's very useful. So like If you are working with the old database SQL or leap pq you are inputting this SQL thing and you can have a lot of new methods like you can
19:26
Struct the row into the structure or You can you can scan the Scholar into the variable or you can create a slice from your rows, etc. Etc. It's very cool
19:44
Pjx at that time Provide that But with the latest version 5 Everything is already there better is included
20:06
Probably you can find Cases Where you want more control over decoding encoding? but after after these Guy was introduced row to struck by name
20:23
Written by me by the way. Yeah Everything became very easy So before that you we have we had only road to struck by Position, right? So if you're if your structure
20:40
Fields are in the same position as your Field in your row result set you're fine. You're just like doing the back and forth and but if you want to skip some fields or For example if you have some non public fields in the structure But still want to use this functionality to decode in code from from from the results that this is the way to go
21:09
Yeah now about testing we all know it's very essential, right
21:20
And I heard a lot this Statement that you need to write your tests first and only then implementation I never did Maybe maybe one of us tried it. Oh Go
21:40
Go I'm too lazy Because I never know where we're at the end. I will go with my code. I'm starting like, okay I will implement this thing that will return this integer and then another oh, no, let's do this Cte with a lot of things. Yeah, and if I if I write a test before I need to follow it, right?
22:02
No, it's not funny How we do testing? So I would say there are three main approaches the first one From obviously is to start a real post SQL server You Can have your local installation on the test environment or you can download it during the test running
22:25
Install it initialize Etc then cache but it's still the same. It's a real post SQL server The second approach would be mocking libraries For for databases QL
22:43
That would be Datadog go as go SQL mock and For PGX. I created this PGX mock which is the brother of the SQL mock, but yeah works with PGX
23:00
I Hope you know what is mocking and how these things are working, right? So yeah we are pretending that we are a possible skill server and Our Application our tests are thinking that they are speaking to the real server But in fact, we just throw the needed answers to the application. So these rows, okay
23:23
This is row this row. This is the answer. Oh, no That what is the role? Let's see how you will react on that. It's not right syndrome but if you want to to test on the protocol level There is also some
23:42
very low libraries like PG mock Which is just like the real low level mocking protocol cockroach DB Has its own test server? Which you just like an import cockroach DB test server and use it in your tests
24:05
and another another libraries copyist Okay, let's try to maybe
24:25
Let's get back Okay, so um How the how to create a test how to how to use this PG mocks PGX mock thing?
24:41
So if you read the the readme on the on the repository You will see that no change is required to your application. That's a lie You need to provide an interface because the PGX return Structures is our connection or pool
25:03
We cannot mock structures. We can mock interfaces. So I am defining PGXE face interface here and Say to my method to my function that I will use this interface
25:21
Please use that and for my function is like It doesn't care would it be a real connection or will be mocking or anything it just knows that this object has this methods and It's enough for it. Okay
25:40
So, yeah, we write a code kind of Shitty, okay We're trying to call me we're trying to Throw back, etc. Etc. Etc. How to test it So I will always start with it Successful test cases. I'm very positive person
26:02
First first thing first though, I'm creating the mocking object PGX mock new pool Then I will tell my mocking objects, how should my session looks like right?
26:21
So I'm saying I'm expecting that We will start a transaction. I'm expecting begin Then I'm expecting that the code will try to execute update statement, right and When this happened, please Return to this code the new result that update was successful and we updated one row, right?
26:47
After that, I expect that the code will try to insert something And I expect that the arguments for this statement would be two and three If that is the case
27:02
Please tell that everything is good. We insert one row and After all that I expect that the code will commit the transaction, right? That is what I'm expecting from the code Then I'm calling my function record starts and instead of the PGX
27:25
I'm passing the mocking object mock and two and three arguments, right and If anything goes wrong The test cases fell, right? But another thing I want to do to check
27:42
If every expectation I set were met for example after the commit my code might want to Write a log to the base or do other things. I don't expect that thing from it and
28:01
These Expectations were met will fail If something else happy is happening inside this function, which is not being expected right, so for For fail or failure is pretty much the same We are telling that we wait we want to be expect to start transaction. We expect to
28:27
Start a big statement But let's pretend we want to test how our code will behave if the Insert statement will fail So we are telling so when insert statement is coming with the arguments two and three
28:45
Let's pretend that error happened return a row to our quad and the error with some error text very beautiful We We are starting our function, but in that case we know that it should fail
29:03
That's why we are checking our error to be Not nil we are waiting error, right? and the same for Expectations were met So for example if we failed and our code tries to do more than we are expecting we say no
29:22
Please don't please don't Yeah, so and then you are just using go test and With the t-parse thingy, I just love how how the tables
29:41
Look after after this output so like for the for this case we have like one package and We have two taste cases right but in real application you might have Hundreds hundreds of test cases and Dozens of packages they all be listed and you can see a coverage for
30:05
every package and you can see Probably coverage for every test case how many passes how many fails etc etc Also you want to probably investigate, what is the coverage
30:23
For that you are using the built-in go to cover to That will produce temporary HTML files and will open them in your browser So you see a combo box with the list of files in your application, and you just go through all your code
30:44
The red one is not covered by our test cases the green one Covered by our test cases for example in in this case our main Function is not covered at all Because it's tricky to
31:01
To test the main function. That's why you should like Put it outside of everything and then make it like two three lines and only use your packages inside Okay, so time for
31:24
Continuous integration and continuous What deliver yeah? so We are working as a company. We are working in GitHub, but I'm pretty sure that the same functionality is available on GitLab and
31:42
BigBucket and everywhere right So for every my project. I want to have at least at least five Actions you have actions first one is a dependable I Want my repository is constantly being checked if any package
32:05
I'm dependent on is updated right so it will update okay. We have a new Miner or whatever version of this package it will automatically create the pull request I will check the output If tests are fine if everything is okay, okay?
32:25
Very good. I like this you know because you can do free pull requests per day, and you are super productive Then what I want to also always have is a code QL which will
32:40
build your Sources and will investigate the possible Security vulnerabilities Building tests I'm using that for pull requests only because if you are firing them on every push and
33:04
The test is heavy It's not fine Release will produce the binaries and packages when the neural is created and The Docker
33:20
Is the same like for release it will produce a special tag and an image and push it, but for every Comet it will produce a special Docker image, which you can just Try immediately right Like a night build whatever yeah, so dependable is very simple for example for almost all my
33:47
Repositories I first want to check the go code itself so package ecosystem go mode And I want to use the latest GitHub actions as well That's important, so I like check them daily, and that's usually enough
34:08
For code QL nothing special when you create these actions from the GitHub interface it will fill all the all the fields for you I Never change very important thing there only remove some comments, and we're fine
34:26
Building tests, I hope you can see what is going on there No Sorry, I didn't want to switch to to the editor because I cannot work like that. Yeah, so I will tell you so I
34:43
Usually run all my tests on three different platforms Windows Mac OS and Linux The the good thing is the All the workers already have was graciel installed on them, but the thing is that it's not started so
35:04
for you Essential is to start with QL and then run your tests, and you are fine usually it's The version of process is behind Like two or three minor versions, but it's okay If you want just like use the latest one you can you can go with a docker right images instead of
35:27
that one Yeah so There in the build action we have Linter so no without Linter we cannot accept any changes or pull requests pull requests
35:45
and Yeah, and then we are using We are generating the coverage report to put them everywhere See Okay, so release is a little bit simpler as I said
36:07
We are using go releaser Absolutely fabulous piece of software may produce Everything for everything so the github Action code is simple because everything is stored in the yaml
36:24
Configuration file where you set up the name the architecture the Everything and then you just like okay let's check out our code and Let's release it and the
36:42
Cool thing about it. This is the girl is there go releaser Will create a change lock automatically for you Based on your pull requests So when I am releasing it's just like I copy pasted just sort it about the by the
37:02
Like what added what fixed and what whatever and I'm done the release is very simple for me absolutely Before that I like they spent two days on each release to produce all these binaries
37:21
Okay, docker Go releaser can produce docker images I'm too lazy to rewrite this and Yeah, I'm using like another special special github actions to build a docker You can build them for every possible platforms and this apple m1 m2
37:45
Silicon thing is whatever It's just working Okay Takeaways
38:01
The goal is popular Devrim doesn't like go yes So maybe maybe this is the last time you see this talk like the when the when everything goes right He said that I need to switch to rust so maybe
38:23
Maybe Maybe maybe next for them. I will go out with the when the rust Goes right. No, no, I should I should I stick to the good? Okay, we can do both. We can do both yeah, so a Lot of developers are using the bases with go, of course
38:46
You can use whatever it did or whatever operating system you are By the way, a lot of people are using Windows which is not common for like postgres community for example but it's fine if you're if you're
39:03
If your system can produce whatever you want, you don't care you just work on what you have, right? So Cooper is You Can use whatever you want with the postgres if you want to use or please do but remember
39:22
You're responsible for that use it wisely otherwise you can use lead pq package or new pjx and you can use whatever GitHub, GitLab, Bitbucket you want and
39:42
the most amazing thing about go is The backward compatibility You can build Whatever in the future in the future whatever code you want and it still will be compatible with the
40:00
oldest English Something written ages before even now when we have generics when we have a cool thing is in go they are still compatible with that old things okay, so Don't be stranger
40:23
check my github account check our blog Yeah, some of our some of our projects And if you have a questions, so maybe you have a question to Devrim why he hates
40:42
Go Okay I'm not sure what the problem is. I provide everything you need take my binders and put them in your packaging whatever Not internet. No, no not internet
41:08
There are these four dependencies for it for okay for a new created Application which uses pjx to connect to the post SQL There are only one direct dependency is pjx and there is only four indirect dependency
41:23
two of them are libraries from Google one of them library from core OS I don't remember and one of them is by the same author Because he's using this package
41:42
in other way Yeah, so questions Hi
42:00
Slides back you went to a certain functionality where you were Asking you did select and then you put in a structure in order to get results from Like it's it's nice. Yeah I have a question on that one It's yeah, this one. Yeah. Yeah exactly. Yeah. Yeah. Yeah, so you're you're asking a select star
42:21
and then some stuff and then you buy the roast does the Does the actual connection so you're if you're running this on one machine you're running Postgres on another machine There is a network of course in between there's data going back and forth It's all the data being sent from the post SQL server to your go chrome or not Sorry is because let's say there's a fourth field which is let's see a JSON
42:44
Huge JSON field or a huge binary field which contains like a megabyte of data per record Is it then sending if I'm asking a hundred records it's a thousand records Is it sending a gigabyte over the network or is it only sending those three fields? Okay, I got you Yeah, thank you. Very good question. So, um
43:02
In this particular case that shouldn't be star First of all, we should always least if a columns we want to have I'm just too lazy and This is not my code, but it's like You know, it shows
43:21
Yeah, so in this case, yes everything Can we do automatically? Can we add columns from a database automatically?
43:43
Yes, we can but for that we should use SQL C SQL C Package Which is exactly for that. So you are it is pre build or Hooks or whatever. So when you say go build you have a special like
44:04
SQL files Like I want this field from that and that and it will go through it and it will build automatically the appropriate structures for go and Then you can use it. Yeah, it's just a lot of information I cannot like put it into the one target
44:25
Yeah, but yeah about if we are loading it all at once. Yes, we do in this case But the postgres protocol itself supports row by row Functionality and it's possible to use
44:42
That functionality with this package so we can like yeah say I have one question about this driver actually, it's kind of only way to work with progress for my opinion and
45:04
I'm a little bit worried that this driver is not supported by Postgres community, let's say it's supported by someone and What is the lifecycle of this software? Maybe it will die you say how is about new features to it and all this question arises when you
45:24
Work with it because if your management says, okay, let's use Java and in Java It's kind of stable this driver and you know that you always have the new version What is about this? Yeah, thank you for a question So versioning and then owner who is owner and that's kind of stuff
45:43
As a postgres field community we support on the C library, which is leap pick you and Java which is JDBC, right? That's all all others Yeah, who uses C++
46:02
okay, so all other libraries are maintained by someone by the way leap pick you is not a Standard library in terms of made by go it also maintained by one person So how we do in this case, we just fork it and use it
46:24
If you want something new if if I did any everything better than the maintainer the owner of the Of the pjx will accept my podcast proposals and we are stinking right? It's not I Will beat him and I will be popular
46:51
Question regarding testing strategies and CICD. So you have shown that it's possible to mock postgres scale, right? But sometimes you are relying on some feature of postgres scale or possibly we are relying on some extension postgres
47:03
We want to test with a real postgres scale. Yes what you can recommend. So I have seen you see ICD Do you have a dedicated instance for running tests? No So My github actions are using in style pre-installed postgres QL on the github workers. They already have
47:26
Has they already has like postgres? Like 15 one probably nowadays, so I'm okay if they are behind like several versions I don't need to you to test for a specific feature or a bug or whatever
47:43
but if I want to in my github action, I may specify the the docker image Against which I want to test. So for example, if I want to taste the latest master from the from the postgres scale community
48:01
I will build my own image docker and will run my test against and I'm fine Okay. Thank you