DB Imports


DB Imports is a furniture company out of Sylmar, California, specializing in display for your business, or items for your home. Open Mon- Friday


Hello guys, so burn 1. 1 was just released and as usual as with burn it always launches a lot of new features and a lot of huge n So I'm just going to go through the most interesting features to me and what caught my eye as I was scrolling through t So the reason why t 1 released was very hyped up was because t So up to now burn couldn't run on windows. So this release allows you to run burn on windows although it's not fully supported but it'so to get it on windows you just have to run t So in the windows partial, so right now if you run burn it's not recognized. So let's paste it and then wait for it to install it and once it completes downloading then we can as they say restart your terminal editor then run burn. So let's just open a new tab and try running burn and just So there's a lot of stuff that you need to fix to get t So let's get that out of the way. So what I'most interested with is the macro section here. So inside our editor just spin up a new burn project. So you just run burn init why. Another thing that's really simple but I really So let's go back to macros. So suppose I have a file here called random. ts. So this file here exports a function named random that simply returns a random n ts file here we say we want to call it so console. loc something like the random n So to run ts then we see the output here. Now let's go back to the release post here. So it says burn has a powerful macro system that allows you to transform your code at compile time. Macros can be used to generate code, optimize code and even run code at runtime. So with macros t And how does it work? So first of all let's build t So burn build we want to build the index. ts file and then the out file is say out maybe bundle. ts. So if we open the bundle you can see that it has included the random function inside here and also the file that is calling the random function. So it has bundled it into one file. So I want you to see how macros work differently than the normal bundling. So if we add a width operator here and then say the type is macro So t js. Let's open the macro. js file here. So see the difference in the bundles. So let's open t So you can see the difference in the files. So instead of having to include the function call and then the call to the function call, if we import the file as a macro, burn will run it at bundle time or at build time and then replace the output where that function was called with the actual output. So t log statement with the n So t I didn't know about it but t In band 1. 1, t So if we import something js child process module So with type macro So that will be the result of calling this spouncing function calling the inbuilt echo module and then the arg So we just say echo hello world and then we get the value of std out and we consul. log the result Let'see how t So we want to do the same band build to output to the macro. Also we have an error here. So the encoding should be utf8 Then when you try to run the file, we should now have the generated macro. So let'see what is in the macro t So you can see the result here has been replaced by just the output of that string. So the band rule won't contain the entire c So previously it was supporting local modules but right now it still supports external modules. So on the subject of macros, there is also the sqlite module that band has support for. So with band you can run operations on an sqlite database without having to install an external library. So for example you can use the in-memory database, you can run statements and all those. I t 1 is that instead of having to create individual statements for all these 1 you can run them as one statement. So there is somet So let's copy t So we just create a new file here, let's call it a sADB, then paste that code there and then we run it. So bandrun db. ts w Oh and for t So let'save it into users. db. Right start, then you can test it here by selecting from it. Something query, select everyt So should be result. get I t I don't know if it's asynchronous. So let's run it. So bandrun db. ts, it will create the table, run the select statement and then if you look at the sidebar here, here's the table that has created. So for example, if we add a new file here, let's call it, let's just call it db2. ts. So we can import this db file here into our file without having to import this database stuff and initialize the database So for example, we can do import db directly from the users. db file by using the wheel operator and then setting the type to SQLite. So for example, we can run the same function we ran previously. So you can do db. query, select from users and then log the result where the get function And if we run t So this looks So it's not in an LTS version of Node yet, but you're able to use it in burn So they're called import attributes, not macros. So one other feature of being able to import databases is you can be able to embed the databases after you build the file into one executable. So it will bundle your database with your code. So to do that, we need to add the embed attribute here next to the type attribute and then use the burn build compile functionality there. So next to the type SQLite, we add the embed true, so it should be a string, right? So embed true and then we can run the build. So it should be burn build with the compile option and then the file name, so db2 So it will bundle that into an executable that we can run by just typing the file name So t Another t 1 is the concept of trusted dependencies. So by default, when you run burn install and you want to install a package, burn does not run its life cycle scripts. So in npm, for example, when you're installing a package, let'say code. js, right? So we do npm install code. js. You get some unnecessary stuff here. For example, here, one package is looking for funding, run npm fun for details, For example, to ask for funding or to market some other t So if we are to do the same t js, so it will just install the package and show you the stats that are useful to you. And you'll notice that there'somet So burn blocks post install scripts by default so that you don't see them. But if the package that you're installing has post install scripts that are critical to the package running, you can make it a trusted dependency. So we can run burn npm and trusted command to see the untrusted dependencies and what code was blocked. So for example, here, t But if we want t So here they say you can run burn pmtrust. So burn pmtrust, then we can say we trust code. js. And then if you look at the package. js file here, you can see that code. js has been added as a trusted dependency. And burn actually comes with a default set of trusted dependencies. So for example, here, we can run burn pmt default trusted to list all the trusted dependencies. So burn pmt default trusted, you'll see all the trusted dependencies. So most of the time, t So you don't need to do t So I t Obviously, t So these Windows build carried most of the features. But apart from t So thank you so much for watc I hope I saved you some time.

Business Details

show address

show phone

go to website

Map
Hours
Mon 08:00 AM - 04:30 PM
Tue 08:00 AM - 04:30 PM
Wed 08:00 AM - 04:30 PM
Thu 08:00 AM - 04:30 PM open now
Fri 08:00 AM - 04:30 PM

Furniture Store in other cities