open-menu closeme
Home
RetroComp icon
Retro Computing Articles Composition Notebooks 8bit
DevOps icon
Automation K8s Done Right
GenAI icon
Fatlama Newsletter Generative AI
Projects icon
Software Projects Arduino Misterio Esp8266 SQLite
Status
Links icon
GitHub LinkedIn
About
github linkedin rss
  • Spring Boot and database testing: production defects

    calendar Jun 17, 2024 · 1 min read
     en java knowledgebase  · spring-boot sql
     ·
    Share on: twitter facebook linkedin copy
    Spring Boot and database testing: production defects

    Sometimes you need to fix a production defect. To do it, you need to mirror a specific set of data, and do a test to proof the bug and then fix it.

    Luckily, SpringBoot provide the @Sql annotation to easily "pump" data.


    Read More
  • I big data sono passati di moda?

    calendar Feb 10, 2023 · 4 min read
     it lettere-a-mia-figlia  · nosql sql sqlite
     ·
    Share on: twitter facebook linkedin copy

    Questo articolo, di tal Jordan Tigani, getta una luce oscura sul futuro dei big data. E’ scritto dal CEO di un’azienda che sviluppa un nuovo database OLAP (Online analytical processing) chiamato Duckdb, che e’ open source ed e’ “embedded”, nel senso che si ispira molto al modo di funzionare di SQLite. L’articolo sottolinea come uno degli argomenti piu’ forti dietro la commercializzazione di sistemi BigData (come BigQuery, MongoDB ecc) e cioe’ l’enorme flusso di dati che avrebbe investito alcune aziende, rappresentando sia una opportunita’ che una sfida, non si e’ verificato nonostante queste profezie siano vecchie di dieci anni.


    Read More
  • SQLite, again (updated)

    calendar Jun 21, 2021 · 2 min read
     en  · sql sqlite
     ·
    Share on: twitter facebook linkedin copy

    SQLite is slowing becoming a new standard. It is fast, and has a growing number of features.

    Useful settings

    1. PRAGMA journal_mode = wal;
    2. PRAGMA foreign_keys = true; Query, set, or clear the enforcement of foreign key constraints.
    3. PRAGMA busy_timeout=....; In milliseconds, the busy_timeout is associated with each connection to the database and as such you need to set the timeout for each connection.
    4. pragma synchronous = OFF; I call this "scissor mode" referring to running with a scissor in hands. This directive disables the call to fsync and it is very dangerous if a power outrange happens on the host. It delegates to filesystem the "fsync". Some database reach full speed disabling fsync call, but your data are not guaranteed to be stored in safe place until operating system flush data (which will eventually occur...).
    5. NUMERIC type is special.... https://news.ycombinator.com/item?id=28069694 From the documentation: "A column with NUMERIC affinity may contain values using all five storage classes. When text data is inserted into a NUMERIC column, the storage class of the text is converted to INTEGER or REAL (in order of preference) if the text is a well-formed integer or real literal . . . If the TEXT value is not a well-formed integer or real literal, then the value is stored as TEXT." So NUMERIC is kind of like TEXT except when the text is a pure number.
    6. SQLite ".expert" can help you to find out missed indexes:
      For most non-trivial SQL databases, the key to performance is creating the right SQL indexes. In this context "the right SQL indexes" means those that cause the queries that an application needs to optimize run fast. The ".expert" command can assist with this by proposing indexes that might assist with specific queries, were they present in the database.

    Relevant reading

    • Hosting SQLite databases on static github pages
    • Distinctive Features Of SQLite
    • SQLite Autoincrement
    • SQLite FAQ
    • Why SQLite succeeded as a database (Hacker News)
    • SQLite small blob storage: 35% Faster Than the Filesystem (Hacker News)
    • SQLite: Small, Fast, Reliable – Choose any three (Hacker News)
    • Replicated SQLITE (give a try)
  • SQL: One of the most valuable skills - Craig Kerstiens

    calendar Feb 19, 2019 · 2 min read
     en sql  · postgresql sql sqlite
     ·
    Share on: twitter facebook linkedin copy

    I admit it. I suffered from an “algebra narcoleptic syndrome” during my relational database lessons at University (1996 circa).

    Ok it is a fake. But it seems so real on these days.

    Boring male sleeping student

    I was unable to avoid sleeping. I learned to love SQL after some years and now I think SQL is the most powerful, direct and useful stuff you can learn.


    Read More
  • Outer full and inner SQL joins: you are wellcome

    calendar Aug 27, 2018 · 1 min read
     en sql  · sql
     ·
    Share on: twitter facebook linkedin copy

    For a complete description see https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins

    All the Join you want
  • SQLite Oracle Compatibility Layer

    calendar Aug 7, 2018 · 1 min read
     en projects python software-projects sql  · oracle sql sqlite
     ·
    Share on: twitter facebook linkedin copy

    The Sqlite Oracle Compatibility Functions is an experimental compatibility layer for SQLite vs Oracle, written in Python 3.

     

    It aims to provide a minimal compatibility with Oracle. The need was having some regular expression functions, and I do not like to work with risky C code, like this university project did


    Read More
  • Removing duplicate rows in PostgreSQL, Oracle and SQLite

    calendar Jun 15, 2017 · 1 min read
     en knowledgebase sql  · evil oracle postgresql sql
     ·
    Share on: twitter facebook linkedin copy
    Removing duplicate rows in PostgreSQL, Oracle and SQLite

    Sometimes you need to remove nasty duplicate on a table, based on a subset of the column. On every big database there is something called “rowid” which can be used to indentify a column in a unique way. On PostgreSQL is called ctid, as we shall see:


    Read More
  • ORA-01461: can bind a LONG value only for insert into a LONG column

    calendar Sep 1, 2015 · 1 min read
     en knowledgebase  · bad oracle relax sql
     ·
    Share on: twitter facebook linkedin copy
    ORA-01461: can bind a LONG value only for insert into a LONG column

    Disapprove with me! Disapprove with me!

    Okey, you know Oracle. A very good database, a very old database, a very solid rock. Not famous for its error messages. I have already stumbled upon a misleading error on the old rock.

    This error anyway is incredible. If you try to push a very long text in a varchar2, you can end up with a


    Read More
  • Oracle Invalid number ORA-01722

    calendar Jul 15, 2013 · 1 min read
     en knowledgebase sql  · bad bug oracle sql
     ·
    Share on: twitter facebook linkedin copy
    Oracle Invalid number ORA-01722

    I stumbled upon a very brain-f**k error on Oracle 10g on these days.

    Context: the following query [sql]SELECT * FROM (
    SELECT TO_NUMBER(CUSTOMER_ID) AS SNDG FROM BAD_CODES_TABLE WHERE
    AND I_LIKE=UPPER(‘STATIC_CONDITION’) AND CUSTOMER_ID NOT LIKE ‘%P%’ ) S WHERE TO_NUMBER(S.SNDG) >2000[/sql] could trigger a Invalid number if CUSTOMER_ID column contains invalid numbers.

    Why?

    Well…if you ask to “explain plan”, you will get something like

    • a table full scan
      • Filter Predicates AND
        • I_LIKE=UPPER('STATIC_CONDITION')
        • TO_NUMBER(S.SNDG) >2000
        • CUSTOMER_ID NOT LIKE '%P%'

    Read More
  • Come evitare iniezioni SQL lato DB in SQLServer, Oracle, MySQL

    calendar Dec 2, 2012 · 2 min read
     it sql  · asp c mysql php sql sqlserver
     ·
    Share on: twitter facebook linkedin copy

     Come evitare iniezione SQL: lato SQL Server (SP_EXECUTESQL)

    In generale va evitato nel modo più assoluto la scrittura di query sql diamiche.

    Va evitato cioè  l’uso lato SQL Server di sp_executesql e EXEC

    Di seguito mostriamo come trasformare una query “dinamica” in una “statica”


    Read More
  • dapper-dot-net - Simple SQL object mapper for SQL Server - Google Project Hosting

    calendar May 15, 2011 · 1 min read
     it sql  · c google hosting net sql
     ·
    Share on: twitter facebook linkedin copy
     

     Dapper is a single file you can drop in to your project that will extend your IDbConnection interface. [...]

    A key feature of Dapper is performance. The following metrics show how long it takes to execute 500 SELECT statements against a DB and map the data returned to objects.


    Read More
  • NoSQL Rocks? We try to understand

    calendar Apr 10, 2011 · 4 min read
     en featured knowledgebase sql  · ideas nosql sql
     ·
    Share on: twitter facebook linkedin copy
    NoSQL Rocks? We try to understand

    At Gioorgi.com we was never a SQL fan. In 2000 we thinked SQL was boring, mostly because sql algebra could be a bit boring. Then we found this book written by one of the father of SQL. Years ago Google and then Facebook popped out with new incredible ideas, for improved and super fast scalability, which eventually turned to the “NoSQL” mantra.

    But NoSQL is a mature technology, or it is only a path traced by the Social company out of there? Let’s explore together…


    Read More
  • SQL Server e Python

    calendar Feb 17, 2011 · 1 min read
     it python sql  · python sql sqlserver
     ·
    Share on: twitter facebook linkedin copy

    L’integrazione tra .NET e SQL Server è data per scontata: in questo articolo esploreremo invece  come accedere a SQL Server da Python. Uno dei vantaggi di python è che è un linguaggio molto facile da imparare, con un notevole numero di librerie e un’ottima integrazione multi piattaforma. Oltre a ciò python offre un sistema di installazione rapido delle librerie (come  Ruby e Perl).


    Read More
  • SQL Server: meta programmazione e meta descrittori

    calendar Feb 6, 2011 · 2 min read
     it sql  · c sql sqlserver
     ·
    Share on: twitter facebook linkedin copy

    In questo articolo della serie SQL Server, vedremo come creare  in modo dinamico delle istruzione per impostare delle policy di sicurezza. Creeremo da zero una stored procedure chiamata sp_FixOverallGrant che in modo dinamico imposterà i profili di sicurezza per due utenze, una in lettura e scrittura (EBRB0_APP) ed una in sola lettura (EBRB0_USR).


    Read More
  • SQLite alter table

    calendar Jul 25, 2010 · 1 min read
     it sql  · cute embedded programming small smart sql sqlite
     ·
    Share on: twitter facebook linkedin copy

    SQLite is a small, powerful embedded database. A friend of mine started using it about six years ago. Some years ago it comes also on top of  Python 2.5. It is used inside

    • FileMaker Bento: its ultra customized model is based on a big sqllite db
    • DropBox client, to store its internal state
    • iPhone: stores your SMS and also other stuff. It is widely used by apps.
    • Apple Safari uses it for HTML5 storage support
    • Google Gears uses it
    • ...and in a lot of embedded product.

    I was annoyed because until version 3.1.3 SQLite did not provide an alter table syntax but… it is quite easy to emulate it with something like this, even if it required a bit of work:


    Read More
    • ««
    • «
    • 1
    • 2
    • »
    • »»

Recent Posts

  • Arduino Q da far crescere
  • Postgres Take it All
  • La ruota del Destino
  • Darth Android
  • Vps Provider
  • Chat
  • RSS Readers

Latest comments

    Giovanni Giorgi

    Copyright 1999-  GIOVANNI GIORGI. All Rights Reserved

    to-top