This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Follow me on Youtube: https://www.youtube.com/@pacingjosh | |
| Initial Prompt: | |
| You are a professional running coach with extensive experience in training individuals of all levels, from beginners to marathon runners. Your expertise includes creating customized training plans that take runners from zero to marathon readiness in 20 weeks more or less. | |
| You understand the importance of pacing, distance, number of runs per week, rest days, and cross-training to prevent injury and optimize performance. | |
| You analyze data from running platforms like Garmin App to provide personalized advice on pacing, based on factors like previous run times, heart rate zones, elevation, and overall performance trends. Using that data, you can adjust training plans dynamically, helping runners improve their speed, endurance, and recovery. | |
| Your coaching style is supportive, adaptive and brutally honest, ensuring that runners stay motivated and injury-free while progressively reaching their goals. You provide weekly training plans, deta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use thiserror::Error; | |
| use std::{result}; | |
| use sqlparser::parser::ParserError; | |
| pub type Result<T> = result::Result<T, SQLRiteError>; | |
| #[derive(Error, Debug, PartialEq)] | |
| pub enum SQLRiteError { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use sqlparser::ast::{ColumnOption, DataType, ObjectName, Statement}; | |
| use crate::error::{SQLRiteError, Result}; | |
| // Represents Columns in a table | |
| #[derive(PartialEq, Debug)] | |
| pub struct ParsedColumn { | |
| pub name: String, | |
| pub datatype: String, | |
| pub is_pk: bool, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mod parser; | |
| pub mod tokenizer; | |
| use parser::create::{CreateQuery}; | |
| use sqlparser::ast::{Statement}; | |
| use sqlparser::dialect::SQLiteDialect; | |
| use sqlparser::parser::{Parser, ParserError}; | |
| use crate::error::{SQLRiteError, Result}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use crate::error::{Result, SQLRiteError}; | |
| use std::fmt; | |
| #[derive(Debug, PartialEq)] | |
| pub enum MetaCommand { | |
| Exit, | |
| Help, | |
| Open(String), | |
| Unknown, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern crate clap; | |
| mod meta_command; | |
| mod repl; | |
| mod sql; | |
| mod error; | |
| use repl::{REPLHelper, get_config, get_command_type, CommandType}; | |
| use meta_command::{handle_meta_command}; | |
| use sql::{process_command}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ./rust_sqlite | |
| Rust-SQLite - 0.1.0 | |
| Enter .exit to quit. | |
| Enter .help for usage hints. | |
| Connected to a transient in-memory database. | |
| Use '.open FILENAME' to reopen on a persistent database. | |
| rust-sqlite | 1> random command; | |
| Error: unknown command or invalid arguments: 'random command;'. Enter '.help' | |
| rust-sqlite | 2> .exit | |
| $ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::borrow::Cow::{self, Borrowed, Owned}; | |
| use rustyline_derive::{Helper, Completer}; | |
| use rustyline::error::ReadlineError; | |
| use rustyline::config::OutputStreamType; | |
| use rustyline::{CompletionType, Config, Context, EditMode}; | |
| use rustyline::validate::{MatchingBracketValidator, Validator}; | |
| use rustyline::validate::{ValidationContext, ValidationResult}; | |
| use rustyline::hint::{Hinter, HistoryHinter}; | |
| use rustyline::highlight::{Highlighter, MatchingBracketHighlighter}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern crate clap; | |
| mod repl; | |
| use repl::{REPLHelper, get_config}; | |
| use rustyline::error::ReadlineError; | |
| use rustyline::{Editor}; | |
| use clap::{App, crate_version}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package gocontext | |
| import ( | |
| "context" | |
| "net/http" | |
| ) | |
| type SomeMiddleware interface { | |
| HandleHTTPC(ctx context.Context, rw http.ResponseWriter, req *http.Request, next http.Handler) | |
| } |
NewerOlder