skip to content

Astro’s biggest release yet

with Fred K. Schott

Astro’s got big news, and Fred K. Schott is teaching us what it means for web dev using Astro.

Topics

Transcript

Captions provided by White Coat Captioning (https://whitecoatcaptioning.com/). Communication Access Realtime Translation (CART) is provided in order to facilitate communication accessibility and may not be a totally verbatim record of the proceedings.

JASON: Hello, everyone, and welcome to another episode of Learn With Jason. I am super excited for today, because as you can see from my hat, I'm an Astro fan, and we're going to be learning all about a brand new release from Astro. They have a new database, Astro DB. So, this is really exciting. I have been fighting my urge to try it, so this will actually be the first time I've ever tried the thing, and here to teach me is a very special guest, but before that, a special shout out to our sponsors, we have Nx and Netlify, both kicking in to make this show more accessible, and they are providing for the captions, which are being written by Ashly at White Coat Captioning today. There's an URL down at the bottom of the screen here, if you want to hit that, you can follow along with human created captions from Ashly. So, thank you very much for that. And, now, with no further ado, let me bring to the stage my very special guest today, Fred Schott. How are you doing?

FRED: Doing well, thanks for having me on.

JASON: You've been on the show before, I always love having you on, but for folks maybe meeting you for the first time, do you want to give us a background on who you are, what you do?

FRED: Yeah, I'm one of the cocreators of Astro, the web framework that's really focused on content focus sites, and we had the big launch this week, which I'm excited to demo you. The fact you haven't used it yet is perfect. That's exactly I wanted to hear. Good crash course on everything.

JASON: Excellent. I'm super pumped. I think this is going to be so much fun. I... like, from the outside, when you all first announced content collections, the very first thing I wanted was non markdown content collections. Maybe there's a database coming, maybe it's going to happen. I'm not sure if Astro DB and content collections work out, I'm excited to find out, but excited this is the way you went. I kind of heard rumblings about it, and, you know, I actually have a lot of questions, sort of follow up questions, but first a high level, give us the 10,000 foot view, what is Astro DB?

FRED: Love to. There's a ton this has been something we've been working towards for a long time, as you kind of alluded to. Content collections were kind of a stab at this, but all local markdown, we added data to that, realized most people were using it as essentially a markdown file with no content and only YAML stuff, so people kind of created a database by hacking markdown. Yeah, definitely a need for this. Something we're super excited about. It is a high level a database directly built into Astro. Local first, everything is local, there's no like you want to do some local development, you want to build an SSG, you actually don't need to talk to a hosted database. At its core, it's this local database layer that is built into Astro and doesn't require all the, like, normal fiddling that, like, I don't know, I hate local development on a database. Spitting up Docker, okay, Postgres, MySQL, heavy tech, running on my local machine, my memory slowed down, and why. This is super lightweight that we can talk about what it's powered by, but at the end of the day, local first. When you want to go to production, we built out a hosting platform for databases so you can easily connect to that when you go to production. We handle all the scaling and setup for you. Yeah, nice model of hosted and local kind of working together.

JASON: Yeah, yeah, and I have a lot of questions about that, because, like, I've heard a lot of this discussion of local first databases. You're using lib SQL. And, so, practically, when you say local first, to me that sounds wonderful for development. I have to not think about any of those things you just mentioned to get my local server up and running for development. What are the implications in production, though? Am I when you say you said build an SSG. Are you saying I can almost statically deploy a database?

FRED: Well, that's the thing about static site, right, you basically do all the building locally. Kind of one those things, where does the database fit in if I'm just building locally. That's the classic markdown, these files live on my file system, I don't need a full database, but we found a lot of people do want structured content. That's what content collections essentially were. It's great for markdown, what's good for data? If you want to have authors and all that data connected to your content collections, if you want to start drawing relationships between data and content, that's where we found database really fits in. Whether you want to host that and make it dynamic so you can write to it in production, a comment section on your blog where people are leaving comments, or if you want this to be structure for your local content, it fills both of those jobs really, really well.

JASON: So, how does it work for for local content, that's actually great, because you're saying I don't need to deploy this database. I just need to have a copy of the data for building. Which is awesome. There are a million cases I would use that as opposed to my forest of JSON files that I have.

FRED: Everyone who's built a site like that has seen that. I guess this is the best we can do. Yeah, every file, JSON file everywhere, CSV, throwing it everywhere, hoping it loads.

JASON: You mention this goes beyond that, mention a comment system. So, if I want to develop a comment system, I'm going to develop locally and get to the point where I got my client side rendering directive for my comment thing. It puts up a form, and when someone submits that form, the Astro DB is deployed for me, do I have to get into the Docker and deployment stuff when I take it live?

FRED: All handled for you. Essentially what your build ends up doing, talks to your database. You're not shipping it's an HTTP proxy, so really lightweight in terms of what you're shipping and we're handling everything on our end to receive the queries, send through the database, and give you output as quickly as possible.

JASON: Very cool.

FRED: Really cool model. Taken us a year to get there. We tried a bunch of things and this is the one once it clicked it really, really clicked. We've been building a lot with it over the last couple weeks.

JASON: I can't wait to try it, but let me ask some tougher questions first. The first question is, you know, is this like some of the other frameworks we've seen, where the cloudification of the framework makes it well, maybe more expensive to use is the kindest way to put it?

FRED: There's meaner ways you can say that. Yeah, we have... we're both lucky, because we've seen how easy it is to go down the wrong path. They are just frameworks, yeah, the business takes over the framework and open source and everything you kind of love about it. So much what I love about what we're doing, we're this open source project the way we structured building a company to support the project, the company supports the project, not the other way around. Everything about how we structure how we work together, core maintainers first, some of those people are staff members, some of them are on contracts, and some of them are just totally volunteers. Everything about the culture we're building is trying to do that, but when it comes down to is incentives. We're trying to build something where this only succeeds if the Astro ecosystem grows, and the Astro ecosystem will only grow, yeah, if we don't make the mistakes of past frameworks, where the framework suffers in support of the business. We see ourself in service of Astro users. It's tough to say more than that, but something we deeply believe in.

JASON: And do you see this as being like, you know, I think the question everybody has about open source that's funded is when does the other show drop and it starts to cost money? We just saw this with Planet Scale. Maybe the right move for them, but for us as people using it below the $40 a month reasonable pay, it was kind of like, oh, crap, I guess that good thing, the capital hit a point where it just didn't make sense for them to keep paying for this, and we lose, right. Do you see Astro DB as being your path toward funding Astro, or is this a step in that direction?

FRED: Yeah, I mean, the short answer is, yeah. This is us we have been fortunate enough to, like, there's the open source project and there's this company we formed, we raised money, and that's been supporting the project in a lot of ways with full time resources, let us take the time and effort to get sponsorships at the open source project has its own funding coming in. It's this huge foundation we've been able to kind of build for the project, but at the end of the day, that does mean there's this kind of what can we do to support Astro, so that the company can keep surviving as not a charity, but as a business. I think there's plenty of good options for examples of this working well. And we're trying to be one of those good ones, but plenty of examples it's working poorly where incentives get misaligned. That's a big thing for us, can we get the incentives aligned so the the Planet Scale thing, I think a lot of the discourse, quote/unquote about Planet Scale, you all just want free stuff. There is no free meal ticket, Planet Scale almost like the backlash became a thing, almost like you're whining about a free thing being taken away from you that you didn't deserve in the first place. I don't think that was it. I think it was more like the frustrating part, besides how the blog post was written, was also how much it was a free plan... hey, build on this, trust us at the end of the day what the company said, then it was removed. When we talk about that internally, it's more like a trust thing is so important. Can we align our incentives so not only do you have to trust us, but it would make no sense for us to rug pull and pull resources out away from you. GitHub is the example I keep using. If they removed their free plan, it would kill the entire platform. It would be no GitHub without open source and free contributions. Maybe it was intentional, maybe it's just built into their DNA accidentally, but that idea of it is so fundamental to the DNA of the project that it wouldn't exist without free open source contributors. That is so Astro that everything we do is in service of trying to hit that for ourselves.

JASON: Absolutely, yeah. Ben is trolling. Is Astro DB web scale?

FRED: We can talk a lot about that. That is 100% a troll. Ben is a troll, everyone needs to know that. If anyone doesn't know what's webscale mean, that's a classic, old video. But for us, the other part of the incentive, can we make this imagine a bad actor looks at billing statement, Salesforce buys you, why do we have a free plan, for us, making it affordable was a big thing, that came down to efficiency. One of the things we love is it's essentially at rest, besides the storage of the data, there's no server that's running, no this free plan has a five second spin up, slow down, if you don't use it for a week, you have to kill it. All these things that are ergonomic terrible experiences come from a place of we have this thing we offered you and it's expensive and we are mitigating that as much as we can. For us, it only works in my mind at scale into the future, because the tech we chose is inexpensive to run, it's free at rest, zero dollars at rest and then scales up when you hit a bunch of traffic. Really, really cool tech. The SQL Lite stuff, and Live SQL is a fork of SQL Lite. I use SQL Lite on a demo recently, and there is no server. It's a file committed into the repo, here's your starter data. How cool is that as a general concept. Obviously, that's not going to fly for the most massive things out there. You know, there's a lot of ways that can fall down. For the size of project on a free tier anyways, knowing your database is yours, whatever, it's in your actually, here's a question. When Astro is doing the local DB, is it storing a SQL Lite your database.db in the repo?

FRED: Yeah, that's what we can do that no one else can. Driver, JS, there's a stack if you want to run it in the browser. So different than anyone else is running, but end result is fast, scalable database. We get to do this because so much of our focus is on the content site. You can build some pretty dynamic stuff. The demo I want to show you is a dynamic, interactive app. It's not limited in that way. If you're building the next Facebook, you should go explore other options, but for 99% what we see people building, not like this will work today and you have to move off it later. If you have to move off of this, you have champagne problems, you have a team of developers, you're ready to get to the next step. This is a really solid bet for almost everything we see people using Astro to build today.

JASON: Love that. I think on that note, I share the same question as Dax, who's also trolling us in the comments. If Astro DB is so good, why am I not using this? I would like to give this a try. Let me switch this over into the paired programming mode after I get to the right screen here, okay, then I'm going to open up this one, and present my screen.

FRED: I have a demo to show you, which I need to find.

JASON: Excellent. While you're finding the demo, I'm going to see if I can remember your Twitter handle first try. I did it, yes. We're talking to Fred today. Give Fred a follow, if you're not already doing so. And we're talking about Astro.build, so let me drop a link to the Astro homepage. And there's also this wonderful link to Astro DB, which we are going to be playing with momentarily. And that's basically everything I know to share. Fred, if I want to give this a try, what do I do next?

FRED: I have an URL for you, my password manager is yelling at me. Going to make a repo, okay, coming at ya. I also love this, such a beautiful website, we can also scroll down this quick to hit on there is a section below this which shows what you can build with this, shows reactions, comments, all things things. What I love about this, you can go full in, build it, also if you have a CMS or markdown you've currently built in Astro on a different system, you can build a common system, you can build a feedback widget. You don't have to move everything over today. You can have this be accessory to the data you already have. Post ID, link to a post and new CMS.

JASON: Love this. All right. So, also, this site really is beautiful. What a great job. Kudos to the team. Love it.

FRED: Like everyone else, stealing linear. Come in, copy, linear, homepage, change some words, and ship it.

JASON: I just built a demo for another company and the design of the landing page I built literally says the headline is "we totally didn't rip off linear," and it's just the linear landing page.

FRED: It's just dark mode and modern. Yeah, we had a team of people that worked on this, did an incredible job. I'm one of the people working on it. Oh, boy. No, it's beautiful. It's very Astro, what I love about it, yeah. Not a total ripoff. All right, enough digging my own grave. For this repo, let's do it.

JASON: I'm ready, okay. I've got let me hide this little buddy. Now I'm looking at this repo. We have an Astro DB demo. Did you want me to clone this?

FRED: Yes. Locally, and let's run it.

JASON: Let me get to my VS Code, which is... yeah, get back to one of these. Then going to GitHub repo clone, this one. Oops, I hope whatever I did not save wasn't important. Find out later, I guess. Okay. So, I've got this site here.

FRED: Can you for my notes, delete that DB time stamp file, I pushed that, you beat me to it.

JASON: Gotcha.

FRED: I don't know how that got in there. Astro, clean, beautiful Astro.

JASON: So, we've got a nice, clean Astro site, got a few pages here. So, homepage, some API routes, we've got a few components, we've got our basic app. Some database stuff, which I'm going to have you explain shortly. And then inside the package, let's see what we've got.

FRED: Looks like a lot. This is our starter template and a couple of things that have been added to it. I'm throwing you a bit of an already built project. If you want to build from scratch, please, we can run NPM Astro, do that, but figure have something to sink our teeth into.

JASON: Let's look here, and if we have time, create Astro and see how that feels.

FRED: I would go to the Astro config file. That will kind of give you a summary more than the package JSON, what are you working with, what have we set up for you here. Line nine, that's kind of the important one here.

JASON: We've got the database and we've got React. We're using server mode. We're running it as a node app.

FRED: I wasn't sure what your favorite deploy host is, so I threw in the node deploy. Super easy.

JASON: Love it. So, let's do that. I'm going to just start this thing up, and four, three, two, one... and here we go.

FRED: And here we go.

JASON: Did we... oh, look at this. It's like a drawing app.

FRED: I've been working on this as we've been building. If you refresh the page, all still there? No, it's not still there. That is likely because I have given you a little bit of a playground here, but there actually isn't implemented yet. I didn't do everything for you. Missing stuff in here. You're going to have a drawing app that's both pixel based but also collaborative. If other people go to the website, I don't know if you feel comfortable throwing it at your stream, but the goal is to get it hosted and up and running.

JASON: Yeah, let's do it. Chat, you have to be on your best behavior because I'll immediately take all the fun away if you do anything silly.

FRED: I'll show you where you can add a slow down, so people can't draw there's rate limiting and stuff. Good stuff in here. The two things I'd say that are kind of fun, front end, but the two API endpoints are where we have given some stubs. There's the refresh, which is fetching, and the click, which is what happens when you click. Both of those are doing nothing right now. Totally static. On the front end, showing you a quick response of what you just did, but actually nothing is being saved to the database yet.

JASON: These are our to dos, and looking here you've got a rate limit setup and LRU cache, nice. Then we're posting whatever the details are of the thing, but not currently saving them. Yeah, embedded on an Astro site. All right, got an app, paint, and get a canvas, and we click things and it fires off, yeah, all right, got it. I'm here. Makes sense, okay, I'm ready.

FRED: This is where the fun starts. Run Astro add DB, that's what adds the integration you saw in the config file. We're figuring out does this come built into Astro in the future, keep it forever as an integration, I don't think we really know the answer yet, but doesn't come on with Astro out of the box. Astro add DB sets it up for you. Really nice balance between the two. DB config is where the tables are defined. Get defined table, define columns, and then how do you migrate in production. So, this really kind of seamless Astro DB push command, which will basically synchronize your config file with your production, you know, prevent data loss, but try to automate as much as possible, so you're not managing a bunch of migration files. We'll likely add that in the future, but it's super lightweight. You have to learn how database migrations work before you have to use Astro DB. It's meant to get out of your way.

JASON: Right, that's one of the challenges I've had with a lot of these tools is they make a lot of assumptions about how much background you have as a DBA. For somebody like me, who has no background as a DBA, it gets really confusing really fast. I actually was trying to build something with drizzle recently and I fell down on the first step, because it kind of skipped the part, here's how to set up your tables. I didn't know how to do that, so I had to do a bunch of Googling, ended up writing a post about it, because I couldn't find it anywhere. It's nice this is sort of like this feels the same way as when I define a schema in Zod or something. It's going to work. I don't have to know there's a first time run step or something. You're just going to pick that up for me.

FRED: One of the cool things is we're built on Drizzle. What we've brought if anything we've simplified and opinionated a couple things to help solve that exact problem. You still the way we treat it internally, Astro teaches you more of HTML and TSS, our goal is you're secretly learning SQL as you go without ever writing it yourself. Can we get you spin up, simple stuff be simple, but how do I do this filter, group them this way, order this way, starting to pick up different parts of SQL that the aura pretty much matches the syntax but tries to be as friendly and TypeScript enabled but get all the stuff that SQL doesn't give you.

JASON: Very cool. All right, there's an actual question. This will work with static mode you said?

FRED: This app won't. It's a good example it will technically build and show you a site, but there's a click that talks to a server, then writes to a database, that means that's a server run app. This is not static. You could imagine, as long as your data is static, really isn't a write happening, but that's going to be like any HTML, JavaScript, all that data loading would happen locally.

JASON: If I were to set one of these up to make my own home rolled version of WordPress which someone was talking about this could be a better WordPress from a developer standpoint, I could go in and define my blog tables, author tables and stuff, build the whole site statically using this schema, Astro DB, and that database isn't actually available from the static side.

FRED: Yeah, like a database that only exists during your build and gets wiped away at the end.

JASON: This is actually, what I really like about this, is one of the things that was so exciting about the early days when we called this stuff Jamstack is there was this idea that you could have access to all of your data, all of the servers, all the things that you needed, but then you got this added security of when you ship to production, it was static files with no tie to the server or the database or any of this stuff. It was literally unhackable. You could deface the static assets but couldn't get to the data because it wasn't there. The reason I think it was hard is you had to understand de coupling and all the different ways databases fit together. Whereas in this case, it's all part of the same thing. That's really nice.

FRED: Yeah. One of the questions we've gotten the most frequently. I can set up a database, there's Drizzle, why do I need this. That's exactly kind of what we're excited about here. Once you bring it all together in an opinionated way, there's a story there. Yeah, feels like it could be a CMS, where your content lives, content layer, data layer, and opens up a ton of did issue yeah, doors open up. Sounds so dramatic, we're still grappling with the implications of what we built. It's a site builder, we're not developing a rocket, but, yeah, it's really cool what this unlocks and where this will take us.

JASON: So, another question from the chat is will we be able to bring in our own Live SQL database server and plug it into Astro DB?

FRED: That's a tough one. Right now we're not building for that. If you want to go hosted, it's all designed to work with our database. There's a couple technical reasons where we're automatically resolving migrations for you, that's all code we're running that needs to exist on the other side of that. Can't just be a dumb database. We're also trying not to block people from doing that. If you wanted to hack it in, build your own migration system, database, there are currently in our Discord. It's an integration, you can imagine this being a third party fork. We really don't want to limit and kind of block it, but we're also not building for that. Again, we don't really know what this thing is going to be yet and there are a couple features we think only work when we take that opinionated vertical approach to it. But if someone wants to, yeah, we're not going to be like, no, you can't do this, and lock did down for arbitrary reasons. Technically, build it yourself, not our focus right now until we got further. It will come eventually. Just a question of when, I'd say.

JASON: Got ya. One more question from the chat then I want to start building. Is the colon in Astro DB an NPM thing or something else?

FRED: Good question. Stop me if this becomes the nerdiest tangent ever. It's a naming convention. It's an us thing and that we've decided that's what these imports should look like. We own the framework, again, we can say when you see this import, load this module. We control that in the app. But what I love about this, this is what Node is doing and other projects. Almost like runtime colon. I think it aligns with what we see Astro as, runtime for your app. It's not a package. It's the actual environment. Build your naming conventions to match what you think of as node. Getting stuff out of the node ether. In Astro you're getting them out of the Astro runtime, out of the Astro itself, versus on a fig package that doesn't really exist.

JASON: Got it, got it, got it. Yeah. Extra details from the Astro account that has been steadily trolling you, but I keep missing it when it's relevant.

FRED: Look at this, it's a helpful post.

JASON: I do think that is really cool and I like that we're starting to move that way, because it moves away from magic aliases, like one of the things that always, like, confused me was when you would import path or FS or something, and it was like, wait, but I don't have to install that one. So, I really like that now it's being done as node:fs because I know it's built in.

FRED: Way overdue.

JASON: This is nice, because we're not aliasing import from DB, because that would be confusing, but import from Astro:db, oh, wonderful, it's very clear what's happening.

FRED: What demo is doing, I don't know, people would probably say this is too much, but every package should be NPM colon, that's where you're importing from. Node colon for the node stuff, NPM colon. No one else is doing that, so it's a little much, but I like conceptually, the logic in my brain all clicks there.

JASON: The clarity, yeah. But that feels like a

FRED: Do I want to use it, no, not really.

JASON: Fine line before we end up at Java, right?

FRED: Exactly. Dot com, exactly.

JASON: All right, so, I am ready to actually start building a little bit. We know the landscape. We've got a Canvas app, we can paint a pixel at a time. We have all the front end built for it and the stubs of the API routes and this database here. What is seed, what happens in seed?

FRED: Took us a while to get this right. Every time you run up the local dev server, it's going to run and seed your database. Simple, it's a function. What you have at the top is how our Drizzle LRM works. You have the DB, the arm itself, the query builder and grid cell is the table you defined. Importing now out of Astro DB as a defined able, it exists, and you can use it. Fully typed. If you're missing a value, it's going to yell at you. Fake value, it's going to yell at you. If the types are wrong, it's really guiding you through all the things you can catch statically, it's going to catch for you before you run the code.

JASON: I've said this before and I'm going to repeat myself. I truly believe that the best TypeScript is the TypeScript I'm not even aware exists. I think when library authors do such a good job with their TypeScript that it is completely invisible to the end user, that's the best outcome we can hope for as TypeScript users.

FRED: Sorry, keep going. Totally agree.

JASON: This feels really good. The fact if I'm in here and just start typing, you know, grid cell, and I have no idea what's in it, and I can just do something like this to get the details. That's huge. That makes me want to use a library opposed to Google what this is. This doesn't that's relevant to my app. There's a whole thing. Starts to feel very natural and I'm assuming it works it does with the auto import here, where I can look at what's available. Oh, that's my table. Great, pull in my table and it just works. Magic, magic, magic, but good magic.

FRED: 100% agreed.

JASON: All right, so, do I need to seed the database? I notice it doesn't currently have anything on it.

FRED: So, yes, it is currently been seeded. Takes care of all that for you, because we don't have the select working, we haven't implemented it yet, you're seeing a blank screen. Yes, it is seeded correctly for you, hopefully, everything is going right. I think that's what that log line is implying. Although maybe could be a little more clear.

JASON: Perfect. All right. So, I'm ready to go then. I'm going to hop back into which first, click or refresh?

FRED: Let's do refresh first, because that's going to get it, then we can change the seed file and you'll see it updated immediately. It's going to clear it out and reset, ephemeral dev database. Let's start here.

JASON: Okay, what do I do first?

FRED: Outdated to do message. The to do is telling you to do the wrong thing. Not trying to update anything here. We are trying to line five there, empty array.

JASON: Everybody forget you saw that to do. We're going to do something different.

FRED: You want line two to become an actual database query and not just an array.

JASON: Okay, for me to do that, I'm going to make some assumptions. I want to import DB from Astro DB. And let's see, I want to get my cells, so I want to get the grid cell. And let's see what I can intuit here. If I want to DB select, then this is going to take

FRED: This is where if it's your first time using Drizzle, it doesn't hurt. It's not admitting defeat to check the docs there. It's just every RM is different. Exactly. Where are you doing the pass, what columns you're selecting. Every RM has a different take on this. Open up the Drizzle docs can be the easiest way first time you're using it.

JASON: You want me to do that, or you want to be my docs today?

FRED: I'll happily be your docs. DB select no arguments and doc from is tell me where. That would be source, yeah.

JASON: Then... that's going to give us back, yep, everything that we need. Is that it, are we done?

FRED: Let's see. I actually in my code had a .haul at the end, which is give me everything. I don't know if that's required.

JASON: I screwed something up here.

FRED: Might be try .all, because there's .get, which is get me a single thing.

JASON: There it is, okay.

FRED: Now the seed file, change the color to anything else. Right now you had gray I think is what you were working with. Change that to anything else.

JASON: We'll go with... obviously.

FRED: We all have hex codes memorized.

JASON: I just wanted to say a dirty word.

FRED: One second there.

JASON: So, it's refreshing, but did it run? No, watch seed, okay. So, did I do we... insert cells

FRED: This is what I get, I tried to wrap this in a transaction right before so it would go a little bit faster and I think I screwed thing up. Remove line 5 and 9. Instead of doing this efficient transaction thing, we're just going to... then instead of tx dot, you're going to do DB dot. Now try again, see if that... hmm... hmm... that should be working. It was working for me.

JASON: Now what have I done?

FRED: Let's check. Let's go into the dev console and look at what the network is telling you. Open up your dashboard, dev tools, look the at network, what's coming out of the refresh. Look for a refresh call.

JASON: One of these. And we'll grab this one. Nothing.

FRED: Nothing, okay. There's nothing actually coming back. So, oh, are you awaiting by chance? In the refresh call. I think the seed file is now fine. I think the refresh call is missing. Await. Yeah. It's making the actual fetch. I'm surprised that didn't I guess you can return any response. Look at that.

JASON: Look at us go. Actually, let's see if your transaction thing was fine. And, in fact, it was just me not knowing how async code works.

FRED: That's the gift and curse of TypeScript.

JASON: I need TX. Cannot commit

FRED: Probably here, as well. You want to be careful with your async.

JASON: Await, await, await. Hmm...

FRED: Maybe remove the await on line 7. It's fine without this. This is me being a perfectionist. I think that worked.

JASON: Wrong color now. We're going to roll back.

FRED: This goes

JASON: We'll learn transactions another day. That's a different episode. Let me change it back to gray. Now we're gray.

FRED: Any time you change the seed file, total change to the database. Meant to be ephemeral. You're seeing this, but if you refresh the browser, it's not going to say it. We haven't done anything on the click.

JASON: Here we're back. I've got my click. And we need to update our cell. And, so, again, I'm going to need import DB and grid cell. From Astro DB. And down here we need to do something. I'm going to await, do that first this time. Values. Tells me what they are.

FRED: If you forget anything important, guide you through, which is really neat.

JASON: X, Y, and value.

FRED: Don't run this yet. Take a look at that, looks good. The way this is implemented, it's not inserting when you click, it's updating. That's inserting everything and you're updating the color. Match the syntax here. Let me confer with my cheat sheet, make sure this is what I saw running. That's correct, but one thing about this is when you run update, you're updating everything, unless you put aware. This is the first time playing with aware filters.

JASON: Where the XY.

FRED: Exactly, single cell at location X, location Y. You can actually remove those from the set. We don't want to change them.

JASON: How does this work, is it where equals?

FRED: Exactly. Equals, should have been auto imported. Try to do the auto import. You can update manually.

JASON: Command dot, comes in from Astro DB. I want X equals what is it, grid cell X?

FRED: Yep. Flip those. Maybe that works.

JASON: I think it will do either, but I'll flip it. That probably makes more sense. So then I can take that one out. I need the why as well. Then I need an and.

FRED: Someone's used Drizzle before.

JASON: Exactly one time. Had to write a blog post about it.

FRED: This is the kind of thing I always forget the syntax. Once you have a code base and seen a couple, you can refer to your own code. Again, Drizzle docs here, pretty good at this.

JASON: Okay, so, looking at this, we have our database, we're going to update the grid cell table, we're going to set the value where the X equals the current X and the Y equals the current Y. We'll just change the color. Okay.

FRED: I have a dot run at the end. I don't think it's required, but in the interest of full kind of perfection, explicit perfection here, I think that's telling Drizzle I'm done, run this thing. There's no response here we care about, this is good enough.

JASON: Got it. We are awaiting this, okay. Theoretically speaking, now when I go in here and click this button, refresh

FRED: Need a drum roll?

JASON: Absolutely I need a drum roll.

FRED: My mic is going to fall. I have the most janky set up.

JASON: All right, getting what we wanted. That is excellent. Way faster this time. Maybe that first load. We're good.

FRED: There you go. Most over engineered drawing app you've ever seen powered by Astro.

JASON: I will say I am actually this doesn't feel overengineered. Because I have seen how I've built these, and it was way more complicated than this. The fact that the database is coming in, makes me feel less intimidated by having to build something like this, because I can have this idea and it's just here for me, I don't have, okay, am I going to do I put this into Postgres, shoot, where am I going to get Postgres from, this whole thing, figuring out which service I'm going to use, is this going to be popular enough when the database goes to sleep, I'm going to have people emailing me telling me my database is down. This is nice to know I can ship this thing and it will work.

FRED: Yeah, don't realize how kind of bad some of the current state. One of my favorite things, what would you use today to do this. Walk me through what that looks like. Go to that server, that provider, whoever that is. Okay, it's shut down, I need to spin it back up, get a connection string or a token, set up properly, running locally, but not talking to production. So much that goes into this that you breeze by in this model and that's that kind of vertical integration. Only happens because we've built it all into the framework, we can guide all of it into the actual runtime itself.

JASON: Yeah. Just feels good. It makes me want to build. There's something intangible. Very hard to describe, but there's software when I use it, it makes me want to build stuff, and software when I use it, sort of reluctant to add things, because I don't want to deal with the consequences of my actions. One of the reasons I've been so bullish on Astro from the beginning is when I use it, it makes me want to build things. I'm excited to try a new feature or add something in. And this holds to that ethos, where I'm thinking about this as, yeah, I want to go build some stuff, I'm immediately going to make some terrible decisions with databases on my website, because now I know how to get this in here, and it doesn't I don't know, doesn't feel as heavy. So, very, very excited about this. This feels like it's going to unlock some a lot of, I don't know, we need the weird Internet back and this feels like a great way for folks to build the weird Internet.

FRED: Right on, I love that. I debated, even put the token cash, this whole file could be ten lines total. I was worried you might deploy it and then your audience immediately, all right, how do we take this down, evil, evil hands rubbing together. Figured we'd feel a little safer.

JASON: We have a lot of folks watching right now, so it could certainly be a mess. Speaking of which, welcome to the raiders, glad to have you here. All right, so, we have built a very basic drawing app. It is where we're about halfway through. So, let's deploy this, play with it for a second, and then I want to try building something from scratch and seeing how quickly we can get it done. For me to deploy this, what's the best place to deploy one of these node ones?

FRED: The thing about the node ones, where did you, AWS, Railway, we're going to go outside of my I've been using Vercel mostly, so it's a little outside my wheel house in terms of seeing this run, but up to whatever you want.

JASON: I don't feel enough about Railway to feel confident, so let's switch it to the Vercel deployer and put it there and see if I have an active account. I know I have a Netlify account. I'm going to NPX Astro, add Netlify. Is this going to explode?

FRED: Only one way to find out. If you're trying to be safe, I would no, I think it works.

JASON: Wow! Who built your CLI?

FRED: Probably should have told me I was going to switch it out when we see the problem. No, it's really nice, it's really nice.

JASON: I love it. You did tell me you were going to switch it out. You showed me the code. I looked at this before I committed. To me, this is exactly what I would expect. I'm switching my adapter. Don't try to merge them, don't fail. I showed you what I wanted, do what I want. Didn't realize what I wanted, I'll learn.

FRED: More people need to steal Astro add. It's one of my favorite things about the framework, as someone who's lost a lot of time setting up nonsense.

JASON: Absolutely true. And I don't need to do anything for this doesn't need to be edge deployed or anything, just what the imports are?

FRED: Scroll up to the top of the file. Yeah, I think that's good to go. Delete the node one.

JASON: We're in business. We're going to do a GitHub repo create. And I want to push the existing repository to GitHub. Is this going to explode because I didn't technically fork it? Let's find out.

FRED: You can kill the folder and make it your own.

JASON: Sure. We'll do that for time. Git init, then git remote. Good... everything's fine, yes, all right, we're fine. Then I'm going to git commit.

FRED: Also if you hear my background noise

JASON: Partying behind you.

FRED: Setting on Streamyard, disable background noise. No one can hear this. Very loud call next to me. Walls are so thin.

JASON: I think I killed everything, right. GitHub repo, create. Do this again. Existing one, this is the one we want. Astro DB. Push it up to here, good, good, public. Add a remote, yes. I want it to be called origin. Would I like to commit, yes, I would. There we go. Then I can NPX wait, yeah, Netlify init. I'm realizing some things I don't actually remember how to use Netlify anymore. It's been a minute. Here we go. Wonder if I'm still logged in.

FRED: Like a cooking show, if this doesn't end up working, I can send out the someone spent the time to draw a giant goose. I don't know why. There's a giant goose saying "honk." But here we are. So, if anyone wants to see that, that will be a reward, if this doesn't go all 100%.

JASON: Okay, so, we're going, we're going. Don't need a TOML. It's pushing, it's going. Things are happening. And if I... go out to my Netlify account, which is over here, this one... we'll see Astro DB is building.

FRED: While this builds, I'll tell you what's about to break. It's in production, so there is no more seed database here. Has nothing to talk to. I don't know if this is going to explicitly tell you. It might not talk to anything and every time you make a request it will fail. So, we need this talking to a database. There we go. It said something.

JASON: Cannot install with frozen lock file.

FRED: Oh, maybe not. Oh, I bet it's confused, there's an NPM, I bet it's super confused by that. Remove the lock file from NPM. Maybe not. Oh, I might have made that up. Ignore me.

JASON: It's doing something. Where is all this stuff? Package lock, PNPM lock. I'm going to delete the PNPM lock, because I don't have it. I'm sure if found, install that, NPM is the fall back.

JASON: So, me not me using the wrong package manager notwithstanding, you said this is going to break because we're not seeding the database.

FRED: There is no production database created yet, exactly. This is where the transition into I want a database, I want to go to Astro to provide it for me. That's where you kind of reach out and spin up one of these databases on our platform.

JASON: Okay, how do I do that? I imagine I'm going to need to do that now.

FRED: That platform is called Astro studio, studio, studio. Go you go back to the landing page, there's a link to get started.

JASON: Where did the echo come from?

FRED: This room, I'm telling you. Thin walls, very cavernous echoes. Up in the top right, that will be one place to go. There you go.

JASON: Okay.

FRED: Log in with GitHub. Going to authorize. Welcome. Get your account.

JASON: Do that later, since I imagine I can't imagine the chat wouldn't do terrible things if they had my credit card number.

FRED: Good call. The free plan is incredibly generous, so you wouldn't even need that until you really hit some serious scale.

JASON: Cool, cool.

FRED: Billion reads, a million writes per month. Pretty good.

JASON: I don't think I'm there yet. Okay, so, I'm going to start a project. Import from a GitHub repo seems like the right call.

FRED: Yep, should be good.

JASON: Okay, grant permissions. Going to... yeah, you can see my repos, good, good.

FRED: We just fixed this bug. For some reason keeps sending you back. Interesting, should do that all in one go.

JASON: There you are. Okay, yeah, can do that.

FRED: Love one password.

JASON: It's the best.

FRED: Quick, everyone steal the six digits, go. All right, there we go.

JASON: I don't think about this, but there are hundreds of repos. It did the most recent one first. So, we have got Astro DB, North America east, options all over. Any implication on pricing which one I choose?

FRED: Nope, all the same price.

JASON: We'll use east, we have a good spread between U.S. and Europe. Not Europe. Just pretend U.S. east is the center point of the world.

FRED: All right, we're creating a database, configuring a GitHub repo and now waiting for GitHub to tell us it all succeeded. We're deeply integrated with GitHub. One of your times from Netlify, one thing that bothered me, I need to set up GitHub actions or my special Vercel, CI running, a lot of complexity on the hosting provider and user. Everything has GitHub actions in this model. If you go back to the repo, you see a new action that's going to keep your schema up to date. If you make a change, it's going to handle that for you. If you do a PR, it's going to warn you if you're making a breaking change before you merge. Fully integrated into your PR workflow to keep your schemas up to date.

JASON: That's cool. Here's our Astro stuff just got added in. That's great. Did that trigger a build? Let's find out. This build failed. It said it failed because couldn't log into Astro DB. So then... this one failed. Why did this one fail?

FRED: Oh, complete initializing. Oh, there's one more thing... hold on. Log in required. Run an Astro build remote.

JASON: To authenticate with Astro Studio.

FRED: Of course, yeah, this error message could be more clear. To be clear, this is all early preview, we just launched. Error message and stuff could be a lot clearer. You authenticated GitHub actions but haven't Netlify.

JASON: Of course, so, I need to go into my database and get my app token, okay. And we're going to generate an app token for Netlify.

FRED: This I would do on a secret browser, I don't know how quick your chat is. Somewhere they can't see.

JASON: Too quick. I'm pulling this off screen. Don't look at my file folder. I'm going to generate this. And I've copied and I'm reloading the page. Now you can see the last few digits of it. I generated this Netlify token.

FRED: Probably want to hide when you go back to Netlify, as well.

JASON: Now I need where is it, build settings. Am I oh, I'm in builds, not sites. Let me get into this Astro DB site. Where the heck are you? Here. Then I need site configuration, environment variables. Certain name, I assume it does.

FRED: I just chatted it to you. You can just grab it from chat.

JASON: It is called Astro Studio App Token. Does contain secret values, and we're going to limit it to

FRED: I think you need it in the functions.

JASON: But not runtime.

FRED: What's the difference?

JASON: What's deployed to AWS, server actions y, and the runtime would be, yeah, submitting forms or if you need a token for if you're doing secure proxies. I don't really understand how a lot of that stuff works, but we're going to use the same value for everything. Apparently I can't. This one, let's make that hidden. Deploy previews, branch deploys.

FRED: Paste into all of them, I guess. This is new to me. I'm not familiar.

JASON: I think because I said contains secret values, they are not letting me do all at once. Branch deploys and local

FRED: Enterprise security concepts. You must have four different secrets.

JASON: Very much into the enterprise readiness these days.

FRED: Of course.

JASON: We got it. We have our secret value. Now we're going to go rebuild. Here we go, deploy site. This is going to be the one. This is going to work. Maybe. Or we're going to watch this thing spin.

FRED: Need a sound board. Didn't you have a bunch of boops on the screen?

JASON: I did have a bunch of boops. (Funky music)

FRED: Used to be you would chat, boop would show up, it would fly across the screen. Might be a GIF of me going... noooo... filling up the screen maybe.

JASON: I kind of want to bring that back. I had stopped doing it, because it's so chaotic that for some folks it would completely throw them. Now what are you mad about? Secret scanning. Secrets found in what?

FRED: Yeah, we built it into the file, I think, at this point.

JASON: Prevent exposing secrets, build will fail if these are expected.

FRED: This is a limitation of how we built it. This is a cool feature. I'll give a plus one to this feature. Usually if you see a secret in your code, it's a bad thing. It's not a great thing at this point, but it's something about how we built this where we actually include it in the build.

JASON: I'm just going to turn this off for this project, because I don't want to deal with it right now.

FRED: This is something we're fixing in the next couple days. Just the way it was built in the first version.

JASON: Call it this, I'm going to say true.

FRED: You want it false?

JASON: Yeah, I want it false. Okay, this one. This is it. This is the one that's going to work.

FRED: This is the one.

JASON: Get some music going again. (Funky music).

FRED: I would love the click through wait on the fancy game while you wait.

JASON: That's a good question. I think it was pretty high at first. Here we go.

FRED: Setting up, getting my example ready just in case this doesn't...

JASON: Probably not a terrible idea. Oh, damn it.

FRED: Of course, my God, I love this.

JASON: Here we go, here we go.

FRED: On my plan of hosting this on a previous demo, the actual server for how much traction, free plan on Vercel completely died. Yeah, no, this is like you are sending 5,000 people at once to this demo. That's not going to...

JASON: What?

FRED: What?

JASON: Get out of here, what is this? Function is crashed. Logs, functions. I already have y'all, pull it together. Now, see, this function is no. Unknown application error. Okay, so, it's blaming it on you.

FRED: This is my first time seeing it on Netlify. Early preview.

JASON: I have no idea what this is. Is yours running?

FRED: I got a demo for you.

JASON: All right, throw me a demo.

FRED: Been a while since I've run this. How's it looking? Looking good. All right, looking good. Good luck. Chat, am I allowed to talk to chat, chat? Be on your best behavior.

JASON: Put on your best dad voice.

FRED: Chat, we talked about this. Make sure I share that out.

JASON: I can't believe somebody made a goose. That's amazing. All right, y'all, let's go in here and let's play a little bit responsibly.

FRED: I want to know who did the goose. Weird thing about these sorts of things, you'll never know. I think the refresh rate, because I was so worried, it's pretty slow. Again, this is not real time. This is like just, you know, whatever is running. It's querying the database every couple seconds, could be running. Let's see. Rehitting this, might be the honk, that would be incredible.

JASON: Such an enormous amount of effort.

FRED: Red squares in the top left went away.

JASON: Clearing out. There we go. I love that.

JASON: Stuff is happening. Somebody put sunglasses on the goose, I love that.

FRED: I'm not going to redeploy, but the version is me being so scared, it's not realtime, what are we doing. This feels slow, because this is not a real time web socket. This is a five second refresh rate.

JASON: We put the refresh on like even in the code here, the refresh rate was it's polling, not web sockets.

FRED: Again, if you are building this, put a web socket on top of it.

JASON: Would this work with Sunil Pai's party kit stuff?

FRED: Totally.

JASON: Chaos, I love chaos. So, this is fun. I feel like... look at everybody actually playing nice. I appreciate you all.

FRED: I do think someone is clearing this out. Whatever set the goose is constantly running thing.

JASON: Fascinating.

FRED: Or you have some very aggressively cleanup people.

JASON: Does look like whoever did it are rewriting colors, because these colors aren't available.

FRED: Yeah, 100%. So, this is great. Super fun. I am going to navigate away.

FRED: So scared.

JASON: I thought somebody was drawing weiners and you know it's eventually going to happen in any drawing apps.

FRED: I find it's so easy to mess with the design. I don't know, I saw this a couple times when we were demoing. You can throw a couple white squares and all of a sudden it doesn't make sense. There's enough police in the audience that help that.

JASON: So, we have like 20 minutes left. So, I want to just look at the zero to database approach. We don't have to deploy it or anything, I just want to see how it feels. I'm going to create a new project. NPM, create Astro. And this one... hold on. Make sure Astro at latest.

FRED: Always a good idea.

JASON: That would have been an old version. So, I'm going to get the latest version.

FRED: Glad to have you onboard. Love that little guy.

JASON: Glad to be here. Astro. The so, then we're going to call this one Astro DB from scratch. And I'm going to go empty, because party, right, some TypeScript, strict, dependencies, new git repository. Get our dependencies. Okay. And then for me to actually start using this, I need Astro add DB. Do I need anything else?

FRED: Just depends, not anything that you need. It's do you want to have a front end framework, use tailwind, those sorts of things you can add as you go.

JASON: Let's roll throughout for now and see how we feel. Good, yes, that is what I want. Okay, then I'm going to NPM run dev. Do I already have something running on that? I'm in the parent folder. Astro DB from scratch.

FRED: I have no idea where Astro add did that. Might want to run that again. You weren't in here when you ran that command.

JASON: That's a great it did something, so I'll have to go look what just changed.

FRED: Probably just have an Astro config in that folder now.

JASON: Great, that's good. NPM run dev. And I did stop it, okay, good. Then we can come over here and I'll actually just reload this one. Here's our basic Astro site. Now what I want to do is create something. This is the wrong project. I'm going to actually need to stop, open this one up, shut this one down, and we'll start again. Now we're running for real, and I've got my database here, my config, and, so, for me to do a table, I could just name it whatever I want.

FRED: Yes, whatever you want.

JASON: Okay. I notice y'all did a Pascal case. Is that a recommendation or

FRED: Yeah, you can really do anything here, but that's what we'd recommend. Upper camel case.

JASON: Okay.

FRED: There's a whole everyone has their thoughts on this. I would even say we are more following the prisma model, which is it's not plural, if you really want to get in the weeds, you're selecting post. Give it more like a model, this is like the class name almost. This is a post. That is totally subjective up to the author.

JASON: So, if I want a column, my column can be any of these types, okay, so we'll go with text. And then we'll have some body would be column text. Then we have a post date of a date, and why don't we do a published, and that will be a column.Boolean. Okay, is that it, I'm done?

FRED: Yeah, it's whatever you want it to be. Maybe author, maybe published at, but that's all you need.

JASON: Okay, then gets my post. How does it know how does it update, do I have to do something?

FRED: Oh, yeah, there's one last thing here, which is defined no, it's defined DB there. Save the file again. It should all be working.

JASON: Oh, something crashed. Hold on. Columns is required.

FRED: Post, yeah, yeah.

JASON: Here.

FRED: No, it's on post. Posts should be columns are title God, I'm having trouble saying this in English. Post is an object and has one key, which is columns, and that's going to be the schema.

JASON: I got you.

FRED: I'm surprised yeah, must have a more lax type. That's one of the things that TypeScript should be helping us with here.

JASON: Got it. Okay, so, now if I run this again, new local database created. Okay. Then when I go back into my seed, it's there. Okay. Good. So, if I wanted to, I don't know, await DB insert into wait. What was it? It's DB insert post. Values. And the values are just one value? We'll just do the one. We'll do.

FRED: So good, bunch of garbage placeholder stuff.

JASON: Wow, a post. Then we'll have a date of

FRED: Sounds so sarcastic. Wow, good for you, a post.

JASON: Okay. So, that will be our database, our seeded database, one value in there, just a post, so we can see what's going on. And then I can use this however I want, so if I go in here and I say import DB and post from Astro DB...

FRED: Yeah, if there's any downside about the art demo is that it's kind of throwing you in the React app world. Nice thing about this, because Astro components run on the server, you have access to the database primitive. You don't even need the API layer at all if you're not running client side. You can have this be direct calls to the database and use them in your app however you want. Only when you need the spa mode that you need to worry about an API.

JASON: Yes, okay, so, I'm going to do like a section and then we'll set up a loop and I'll say post.map. I'm going to post. And this knows what it is. Oh, I love that so much. It's so good.

FRED: Yeah, I think I'm such a what I was going to say earlier when you were talking about TypeScript is we've actually always been TypeScript only. Not only TypeScript first or TypeScript easy. Every Astro component is just TypeScript. And the nice thing about TypeScript is it's a super set. It's more than JavaScript. If you just want to write JavaScript, you're fine, you can, and we'll try to get out of your way as much as possible, but TypeScript is its language, it is TypeScript, and because it's .Astro syntax, we don't notice it as much, but it's all there, checking your code, keeping an eye on what you're writing, and hopefully helping as you go.

JASON: Oh, look at it, look at it. It's a full date object again. I was like is this going to make me do date forming, no. I just get to do something like this. Beautiful. Use the platform. I love it. Then we'll also do an if post.published. We'll return null. And I'm going to wrap that in some curly boys.

FRED: Nice.

JASON: Okay, so, this is now, like, we have loaded from the database. I'm going to collapse down this piece here. So, we've loaded from the database. We've got all of our posts, and then we're looping over those posts and creating little listings. So, there it is. All right. Now I want to do we have time? We maybe have time. I want to be able to add a new one. So, let's add a new post. And to add a new post, I'm going to create a form. And my form is going to have a label. That label is going to be for the title, and that's going to have an input, type, text, and name of title... then I'm going to duplicate this for the body, even though I would usually make this a text area, but I'm not going to stress about it. And then I'm going to just put in a button. Type, submit, and save. Okay, so, now we have a post, and I want this to if I do method post, up here I can do something like if Astro. shoot, what is it? Request method equals post. Look at me go. Who needs Fred Schott, everybody? I got this!

FRED: Checking my email, seeing what's going on in the sports.

JASON: Okay, but now I do need you. When I submit this, it's going to give me my form methods here. And, so, I want to get my form data. And that's going to be the new form data out of is it Astro request body?

FRED: Request object, yeah... God, it's been a while since I've used form data directly like this.

JASON: I mean, I can also just get it do you all do it like this, where I can just get the title and the body out?

FRED: I think there's a .form data method on a request. Let me see. Request.formdata.

JASON: Perfect.

FRED: Quick Google. I don't know if that's actually going to...

JASON: Let's do that.

FRED: You can do a console log, too.

JASON: Title.

FRED: Oh, wait, I guess it's asynchronous. Function call is right. I think it was just a promise that it returns, yeah.

JASON: Data.get, perfect. Then we got our title. Duplicate that. And we're going to do the body. Then our date. Will be a new date. And I don't know why I decided it was going to think I had enough time to do publish, because that's always going to be true. And then I want to await a DB.insert. And it's going to go into the post. And we're going to set values, and our values are the title, the body, the date, and whether or not it's published. And you're unhappy because... why?

FRED: Oh, overload.

JASON: No overload matches. Are you saying it's because

FRED: Could be because it's undefined possibly. Try that. Might just need that for all of them. Or for those two.

JASON: That was it.

FRED: Should have been a more clear error message. By default, all the columns are required, not optional.

JASON: Okay. So, then theoretically, we've got this running, so another post. Oh, neat. No! Could not parse content as formed data. All right, I did something.

FRED: No, I think this is good. I think it's the form itself maybe. If you go down to the form, is it all

JASON: Okay, I'm screwing something up. Let's console log the no, it choked on this.

FRED: This is my first time. I've not used that method. I'm throwing you code snippets, I don't know actually how that works.

JASON: No, that's not it. Let's go... Astro oh, do I need to turn on hybrid mode? We don't have right, because I'm not in

FRED: If you went to deploy this, you want it to be a server, because you're doing this, I think.

JASON: Okay, does that change...

FRED: I don't know if that's blocking you, but definitely...

JASON: Yes, it was wait!

FRED: So many gooses on my screen right now. Hey, it worked!

JASON: It worked, but in an odd way. Oh, I have some kind of a lag. It's one behind. Do I need to redirect it?

FRED: It's maybe succeeding and something else is happening, if you go back to the

JASON: Oddly enough, I'm wondering if I need to Astro redirect to itself.

FRED: Right, where's your get command. Where are you fetching them from? I bet it happens above this. Selecting, updating it. Just got to move it.

JASON: Just got to get the order of operations right. That's much easier.

FRED: I like redirecting, because if you do a post and refresh HTML, confirm form, resubmission, then post it again by accident.

JASON: That's true, that's true. Let's do it. I'm going to Astro redirect, and do I have the current page in Astro's object?

FRED: Yeah, Astro.URL. I believe is a full object. You can do .path, .URL, two string, all that's good.

JASON: That will be fine. All right.

FRED: Refresh that. Oh, no. Might need to return it.

JASON: Oh, that would make sense. Got to return it. Okay, so, refreshed here.

FRED: I was like, oh, this demo is going great. Let me throw a really esoteric thing for you to test.

JASON: And now it works. Obviously, this is the simplest possible version of this thing that I could have built, but we literally just built a CMS in ten minutes. Like, what?

FRED: Yeah, really, really cool stuff you can do with this.

JASON: That is really, really incredible. This is super cool. Oh, yeah, Ross caught that, we needed to swap the fetch and post. This is really, really cool. I am immediately seeing things like I have always thought it would be fun to have comments. Did not want to deal with setting up, you know, something like discuss or another third party system. Didn't really want to deal with running a whole Postgres thing, but I'll absolutely make a mess out of my site using this. And a bunch of other little ideas. I want to keep track of little things that I do, but I don't necessarily want to maintain whole, like, separate third party databases to manage that kind of stuff, or try to manage it in notion and import it or whatever the thing is. Being able to throw together a quick schema and quickly jot down my ideas, there's some real magic in here. And I hope that everybody else's gears are turning as much as mine are, because this feels like something special.

FRED: Yeah, I agree. Something we're super proud of and really excited about where this goes.

JASON: This is very, very cool. Fred, where should people go if they want to learn more?

FRED: So, Astro.build is the website, and there's currently a link on the homepage to check out the go to that goose. Check out that goose. Astro DB is live, that's Astro.build/DB. That's all the important stuff is there. Our Discord community is awesome. We're doing a full community day, so go hang out in Discord, there's a lot of fun stuff today going on. Huge video was just posted about our community. Someone basically made a documentary about Astro. It's really cool. There's some cool stuff going on today to check out.

JASON: Very, very cool.

FRED: Yeah, Astro.build is the Twitter handle. You can see everything we're doing for our launch week right over there.

JASON: Excellent, excellent. Dropping a link to that, as well. All right, y'all. This has been a lot of fun. So, let me give one more shout out. We've had Ashly from White Coat Captioning doing all of the live captioning today. Let me turn that little link back on for anybody who wants to see it. That is made possible through the support of our sponsors, Nx and Netlify, and you can find out more about our sponsors and the captioning on the website. So, let me throw a quick link to the site up to you all. As always, if this show is helping you, if you enjoy it, if you want to subscribe, hit the like button, share it with your friends. Just anything to let people know that I'm out here and I exist. Helps me keep going. This is my full time job now, so I'm needy. And if you are checking out things on the site, make sure you go and look at the schedule, because we've got a lot of really good stuff coming up. We're going to learn about structured concurrency, which sounds really computer science y, I'm excited to show off to my friends about that once I've learned it. Val town, which is doing stuff you know what, I'm not going to try to describe it, and Sunil Pai is coming back, we're going to talk about adding state to serverless functions, very interested to see how that is happening. Lots of good stuff coming. Then a bunch of things that I haven't written down yet. So, make sure that you subscribe to the newsletter, do all the things, I've got a Discord. Fred, thank you again for spending time with us today. This was an absolute blast, I really appreciate you taking the time to come and hang out. I know this is a busy week for y'all. So, after this, I think we are going to go and raid Ben, if you're watching on Twitch. If you are not watching on Twitch, you may consider going to...

FRED: Ben, the tables are turning. I'm throwing you now. I'm coming into your chat, and I'm going to be trolling you now. Let's see how you like it.

JASON: I think Ben was planning on going live in like four minutes. So, what do we have to kill four minutes now? Ben, get online! All right. Let's dedicate the next four minutes to trust trolling Ben. I actually had Ben on the show on a different show that I do called Four Web Devs Build the Same App.

FRED: I'm one of the people that uses their YouTube feed like a social network, which I realize other people don't do that. Ben's photo popped up out of nowhere. Flying by my feed. Excited to check that video out.

JASON: This one was super fun. Ben, you may be surprised to note that Ben made a whiteboard app as his app, but it's really cool. It's super fun to see. You should absolutely go and check that out. And let's see, Ben, are you live yet? God, Ben, you're killing me right now.

FRED: Reason we all love Ben. Ben works on Astro, just by chance, and is just a super, yeah, whiteboard web videos, really fun person to follow, so go check him out.

JASON: Absolutely, absolutely.

FRED: Worked on a lot of Astro DB stuff. Pretty instrumental on the CLI. Been a long time, lot of work for him this week, as well.

JASON: Very, very cool stuff. Yeah, I'm going to attempt to raid Ben. Y'all just sit type, troll him in his comments, and he'll be live here momentarily. I was assured. So, we'll see what happens. But with that, I think we're going to call this one done. Fred, thank you so much for spending some time with us. Congratulations on the launch, and, you know, thank you for what you and the Astro team are doing for the web community. I think it's giving a lot of folks like me a lot of new energy to build, and I really do appreciate that.

FRED: Right on. Thanks for having me on. A lot of fun, love this show. Every time, a blast.

JASON: All right, y'all. I'm going to put us into standby mode while I raid Ben. This is the end of the stream. Good bye!